Skip to content

Commit

Permalink
Support tests for release events (#2490)
Browse files Browse the repository at this point in the history
Support tests for release events

RELEASE NOTES BEGIN
It is now possible to run tests for releases.
RELEASE NOTES END

Reviewed-by: Maja Massarini
Reviewed-by: Matej Focko
  • Loading branch information
2 parents 1cd971d + e61ecdf commit b91330f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packit_service/worker/handlers/testing_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
PushGitlabEvent,
MergeRequestGitlabEvent,
AbstractPRCommentEvent,
ReleaseEvent,
ReleaseGitlabEvent,
)
from packit_service.worker.handlers import JobHandler
from packit_service.worker.handlers.abstract import (
Expand Down Expand Up @@ -73,6 +75,8 @@
@run_for_comment(command="copr-build")
@run_for_comment(command="retest-failed")
@run_for_check_rerun(prefix="testing-farm")
@reacts_to(ReleaseEvent)
@reacts_to(ReleaseGitlabEvent)
@reacts_to(PullRequestGithubEvent)
@reacts_to(PushGitHubEvent)
@reacts_to(PushGitlabEvent)
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,32 @@
{CoprBuildHandler},
id="config=build_for_release&release&ReleaseEvent",
),
pytest.param(
ReleaseEvent,
flexmock(job_config_trigger_type=JobConfigTriggerType.release),
[
JobConfig(
type=JobType.tests,
trigger=JobConfigTriggerType.release,
packages={"package": CommonPackageConfig()},
),
],
{TestingFarmHandler},
id="config=test_for_release&release&ReleaseEvent",
),
pytest.param(
ReleaseGitlabEvent,
flexmock(job_config_trigger_type=JobConfigTriggerType.release),
[
JobConfig(
type=JobType.tests,
trigger=JobConfigTriggerType.release,
packages={"package": CommonPackageConfig()},
),
],
{TestingFarmHandler},
id="config=test_for_release&release&ReleaseGitlabEvent",
),
# Copr results for build:
pytest.param(
CoprBuildStartEvent,
Expand Down

0 comments on commit b91330f

Please sign in to comment.