Skip to content

Commit

Permalink
tests-scan: re-enable cross-project 'job' creation
Browse files Browse the repository at this point in the history
Use the new 'command-subject' support in job-runner to bring back
cross-project support for creating 'Job' objects.
  • Loading branch information
allisonkarlitskaya committed Mar 11, 2024
1 parent c0b391b commit f54c3bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions test/test_tests_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def test_amqp_pr(self, mock_queue, _mock_strftime):
"slug": f"pull-{self.pull_number}-abcdef-20240102-030405-fedora-nightly",
"target": "stable-1.0",
"container": "supertasks",
"command-subject": None,
"secrets": ["github-token", "image-download"],
"env": {
"BASE_BRANCH": "stable-1.0",
Expand Down Expand Up @@ -340,6 +341,7 @@ def test_amqp_sha_nightly(self, mock_queue, _mock_strftime):
},
# project/repo doesn't have a custom container name file
"container": None,
"command-subject": None,
"secrets": ["github-token", "image-download"],
"env": {
"COCKPIT_BOTS_REF": "main",
Expand Down Expand Up @@ -392,6 +394,7 @@ def test_amqp_sha_pr(self, mock_queue, _mock_strftime):
"slug": f"pull-{self.pull_number}-abcdef-20240102-030405-fedora-nightly",
"target": "stable-1.0",
"container": "supertasks",
"command-subject": None,
"secrets": ["github-token", "image-download"],
"env": {
"BASE_BRANCH": "stable-1.0",
Expand Down
8 changes: 5 additions & 3 deletions tests-scan
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ def queue_test(job: Job, channel, options: argparse.Namespace) -> None:
"sha": job.revision,
"ref": job.ref,
"name": job.name,

# job-runner doesn't support this yet...
"job": None if job.repo != options.repo else {
"job": {
"repo": options.repo,
"sha": job.revision,
"context": job.github_context,
Expand All @@ -237,6 +235,10 @@ def queue_test(job: Job, channel, options: argparse.Namespace) -> None:
"title": f"Tests failed on {job.revision}",
"labels": ["nightly"],
},
"command-subject": None if job.repo == options.repo else {
"repo": job.repo,
"branch": job.ref,
},
"slug": slug,
"env": env,
"container": job.container,
Expand Down

0 comments on commit f54c3bc

Please sign in to comment.