From d1549b9ca9947611cc6c52976241a64490f16af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 May 2021 15:20:00 +0200 Subject: [PATCH] Commit the work regarding private-results handling. --- britney.conf | 1 + britney.conf.template | 1 + britney2/policies/autopkgtest.py | 4 +++- tests/__init__.py | 1 + tests/test_autopkgtest.py | 16 ++++++++++------ tests/test_policy.py | 1 + 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/britney.conf b/britney.conf index c556cd7..ee4fc89 100644 --- a/britney.conf +++ b/britney.conf @@ -111,6 +111,7 @@ ADT_SWIFT_TENANT = # List of launchpad users/teams that should have read access to any private # result logs ADT_PRIVATE_SHARED = +ADT_PRIVATE_URL = https://autopkgtest.ubuntu.com/private-results/ # Base URL for autopkgtest site, used for links in the excuses ADT_CI_URL = https://autopkgtest.ubuntu.com/ ADT_HUGE = 20 diff --git a/britney.conf.template b/britney.conf.template index 3855425..7c21e5f 100644 --- a/britney.conf.template +++ b/britney.conf.template @@ -133,6 +133,7 @@ ADT_SWIFT_TENANT = # List of launchpad users/teams that should have read access to any private # result logs ADT_PRIVATE_SHARED = +ADT_PRIVATE_URL = # Base URL for autopkgtest site, used for links in the excuses ADT_CI_URL = https://example.com/ # Enable the huge queue for packages that trigger vast amounts of tests to not diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 1a49669..bbfc2f3 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -1328,7 +1328,9 @@ class AutopkgtestPolicy(BasePolicy): run_id, 'log.gz') else: - url = os.path.join(self.options.adt_swift_url, + # Private runs have a different base url + results_url = self.options.adt_private_url if self.swift_conn else self.options.adt_swift_url + url = os.path.join(results_url, self.swift_container, self.options.series, arch, diff --git a/tests/__init__.py b/tests/__init__.py index 3625953..acbe475 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -400,6 +400,7 @@ ADT_SWIFT_PASS = ADT_SWIFT_AUTH_URL = ADT_SWIFT_TENANT = ADT_PRIVATE_SHARED = +ADT_PRIVATE_URL = ADT_CI_URL = https://autopkgtest.ubuntu.com/ ADT_HUGE = 20 diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index 76ec47c..281889a 100644 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -2564,6 +2564,8 @@ class AT(TestAutopkgtestBase): print('ADT_SWIFT_AUTH_URL = http://127.0.0.1:5000/v2.0/') elif line.startswith('ADT_PRIVATE_SHARED'): print('ADT_PRIVATE_SHARED = user1 team2') + elif line.startswith('ADT_PRIVATE_URL'): + print('ADT_PRIVATE_URL = http://localhost:18085/private-results/') else: sys.stdout.write(line) @@ -2600,18 +2602,18 @@ class AT(TestAutopkgtestBase): {'lightgreen/2': { 'amd64': [ 'PASS', - 'http://localhost:18085/private-autopkgtest-testing-joe-foo/' + 'http://localhost:18085/private-results/private-autopkgtest-testing-joe-foo/' 'testing/amd64/l/lightgreen/20150101_100101@/log.gz', None, - 'http://localhost:18085/private-autopkgtest-testing-joe-foo/' + 'http://localhost:18085/private-results/private-autopkgtest-testing-joe-foo/' 'testing/amd64/l/lightgreen/20150101_100101@/artifacts.tar.gz', None], 'i386': [ 'REGRESSION', - 'http://localhost:18085/private-autopkgtest-testing-joe-foo/' + 'http://localhost:18085/private-results/private-autopkgtest-testing-joe-foo/' 'testing/i386/l/lightgreen/20150101_100100@/log.gz', None, - 'http://localhost:18085/private-autopkgtest-testing-joe-foo/' + 'http://localhost:18085/private-results/private-autopkgtest-testing-joe-foo/' 'testing/i386/l/lightgreen/20150101_100100@/artifacts.tar.gz', None]}, 'verdict': 'REJECTED_PERMANENTLY'}) @@ -2632,6 +2634,8 @@ class AT(TestAutopkgtestBase): print('ADT_SWIFT_TENANT = tenant') elif line.startswith('ADT_SWIFT_AUTH_URL'): print('ADT_SWIFT_AUTH_URL = http://127.0.0.1:5000/v2.0/') + elif line.startswith('ADT_PRIVATE_URL'): + print('ADT_PRIVATE_URL = http://localhost:18085/private-results/') else: sys.stdout.write(line) @@ -2670,14 +2674,14 @@ class AT(TestAutopkgtestBase): {'lightgreen/2': { 'amd64': [ 'PASS', - 'http://localhost:18085/private-autopkgtest-testing/' + 'http://localhost:18085/private-results/private-autopkgtest-testing/' 'testing/amd64/l/lightgreen/20150101_100101@/log.gz', 'https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64', None, None], 'i386': [ 'REGRESSION', - 'http://localhost:18085/private-autopkgtest-testing/' + 'http://localhost:18085/private-results/private-autopkgtest-testing/' 'testing/i386/l/lightgreen/20150101_100100@/log.gz', 'https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/i386', None, diff --git a/tests/test_policy.py b/tests/test_policy.py index bea9f97..c6600c0 100644 --- a/tests/test_policy.py +++ b/tests/test_policy.py @@ -48,6 +48,7 @@ def initialize_policy(test_name, policy_class, *args, **kwargs): adt_swift_tenant='', adt_swift_auth_url='', adt_private_shared=[], + adt_private_url='', adt_success_bounty=3, adt_regression_penalty=False, adt_retry_url_mech='run_id',