From f54c3bcd3cf209190483080da455b636e780550e Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Mon, 11 Mar 2024 18:02:11 +0100 Subject: [PATCH] tests-scan: re-enable cross-project 'job' creation Use the new 'command-subject' support in job-runner to bring back cross-project support for creating 'Job' objects. --- test/test_tests_scan.py | 3 +++ tests-scan | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/test_tests_scan.py b/test/test_tests_scan.py index b8c6f5ad20..579808cce9 100755 --- a/test/test_tests_scan.py +++ b/test/test_tests_scan.py @@ -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", @@ -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", @@ -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", diff --git a/tests-scan b/tests-scan index 94bbb303b1..553a28b8f4 100755 --- a/tests-scan +++ b/tests-scan @@ -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, @@ -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,