Put autopkgtest state files in their own namespace

ubuntu/rebased
Paul Gevers 7 years ago
parent 575993d77b
commit 7e8ec20bc1
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -88,7 +88,7 @@ ADT_AMQP = file:///srv/release.debian.org/britney/var/data-b2/output/de
# space separate list of PPAs to add for test requests and for polling results; # space separate list of PPAs to add for test requests and for polling results;
# the *last* one determines the swift container name # the *last* one determines the swift container name
ADT_PPAS = ADT_PPAS =
# set this to the path of a (r/o) results.cache for running many parallel # set this to the path of a (r/o) autopkgtest-results.cache for running many parallel
# britney instances for PPAs without updating the cache # britney instances for PPAs without updating the cache
ADT_SHARED_RESULTS_CACHE = ADT_SHARED_RESULTS_CACHE =
# Swift base URL with the results (must be publicly readable and browsable) # Swift base URL with the results (must be publicly readable and browsable)

@ -118,7 +118,7 @@ ADT_AMQP = file:///path/to/britney/debci.input
# space separate list of PPAs to add for test requests and for polling results; # space separate list of PPAs to add for test requests and for polling results;
# the *last* one determines the swift container name # the *last* one determines the swift container name
ADT_PPAS = ADT_PPAS =
# set this to the path of a (r/o) results.cache for running many parallel # set this to the path of a (r/o) autopkgtest-results.cache for running many parallel
# britney instances for PPAs without updating the cache # britney instances for PPAs without updating the cache
ADT_SHARED_RESULTS_CACHE = ADT_SHARED_RESULTS_CACHE =
# Swift base URL with the results (must be publicly readable and browsable) # Swift base URL with the results (must be publicly readable and browsable)

@ -65,7 +65,7 @@ class AutopkgtestPolicy(BasePolicy):
# tests requested in this and previous runs # tests requested in this and previous runs
# trigger -> src -> [arch] # trigger -> src -> [arch]
self.pending_tests = None self.pending_tests = None
self.pending_tests_file = os.path.join(self.options.state_dir, 'pending.json') self.pending_tests_file = os.path.join(self.options.state_dir, 'autopkgtest-pending.json')
# results map: trigger -> src -> arch -> [passed, version, run_id] # results map: trigger -> src -> arch -> [passed, version, run_id]
# - trigger is "source/version" of an unstable package that triggered # - trigger is "source/version" of an unstable package that triggered
@ -80,7 +80,7 @@ class AutopkgtestPolicy(BasePolicy):
if self.options.adt_shared_results_cache: if self.options.adt_shared_results_cache:
self.results_cache_file = self.options.adt_shared_results_cache self.results_cache_file = self.options.adt_shared_results_cache
else: else:
self.results_cache_file = os.path.join(self.options.state_dir, 'results.cache') self.results_cache_file = os.path.join(self.options.state_dir, 'autopkgtest-results.cache')
try: try:
self.options.adt_ppas = self.options.adt_ppas.strip().split() self.options.adt_ppas = self.options.adt_ppas.strip().split()
@ -566,7 +566,7 @@ class AutopkgtestPolicy(BasePolicy):
testinfo = json.loads(tar.extractfile('testinfo.json').read().decode()) testinfo = json.loads(tar.extractfile('testinfo.json').read().decode())
except (KeyError, ValueError, tarfile.TarError) as e: except (KeyError, ValueError, tarfile.TarError) as e:
self.logger.error('%s is damaged, ignoring: %s', url, str(e)) self.logger.error('%s is damaged, ignoring: %s', url, str(e))
# ignore this; this will leave an orphaned request in pending.json # ignore this; this will leave an orphaned request in autopkgtest-pending.json
# and thus require manual retries after fixing the tmpfail, but we # and thus require manual retries after fixing the tmpfail, but we
# can't just blindly attribute it to some pending test. # can't just blindly attribute it to some pending test.
return return

@ -152,7 +152,7 @@ class T(TestBase):
pass pass
try: try:
with open(os.path.join(self.data.path, 'data/testing/state/pending.json')) as f: with open(os.path.join(self.data.path, 'data/testing/state/autopkgtest-pending.json')) as f:
self.pending_requests = json.load(f) self.pending_requests = json.load(f)
except IOError: except IOError:
self.pending_requests = None self.pending_requests = None
@ -368,7 +368,7 @@ class T(TestBase):
self.assertNotIn('Failure', out, out) self.assertNotIn('Failure', out, out)
# caches the results and triggers # caches the results and triggers
with open(os.path.join(self.data.path, 'data/testing/state/results.cache')) as f: with open(os.path.join(self.data.path, 'data/testing/state/autopkgtest-results.cache')) as f:
res = json.load(f) res = json.load(f)
self.assertEqual(res['green/1']['green']['amd64'], self.assertEqual(res['green/1']['green']['amd64'],
[False, '1', '20150101_020000@']) [False, '1', '20150101_020000@'])
@ -1390,7 +1390,7 @@ class T(TestBase):
self.run_it( self.run_it(
[], [],
{'lightgreen': (False, {'lightgreen/2': {'amd64': 'REGRESSION', 'i386': 'RUNNING'}})}) {'lightgreen': (False, {'lightgreen/2': {'amd64': 'REGRESSION', 'i386': 'RUNNING'}})})
with open(os.path.join(self.data.path, 'data/testing/state/results.cache')) as f: with open(os.path.join(self.data.path, 'data/testing/state/autopkgtest-results.cache')) as f:
contents = f.read() contents = f.read()
self.assertNotIn('null', contents) self.assertNotIn('null', contents)
self.assertNotIn('None', contents) self.assertNotIn('None', contents)
@ -2299,11 +2299,11 @@ class T(TestBase):
### 'lightgreen': ['amd64', 'i386']}}) ### 'lightgreen': ['amd64', 'i386']}})
def test_shared_results_cache(self): def test_shared_results_cache(self):
'''Run with shared r/o results.cache''' '''Run with shared r/o autopkgtest-results.cache'''
self.data.add_default_packages(lightgreen=False) self.data.add_default_packages(lightgreen=False)
# first run to create results.cache # first run to create autopkgtest-results.cache
self.swift.set_results({'autopkgtest-testing': { self.swift.set_results({'autopkgtest-testing': {
'testing/i386/l/lightgreen/20150101_100000@': (0, 'lightgreen 2', tr('lightgreen/2')), 'testing/i386/l/lightgreen/20150101_100000@': (0, 'lightgreen 2', tr('lightgreen/2')),
'testing/amd64/l/lightgreen/20150101_100000@': (0, 'lightgreen 2', tr('lightgreen/2')), 'testing/amd64/l/lightgreen/20150101_100000@': (0, 'lightgreen 2', tr('lightgreen/2')),
@ -2315,7 +2315,7 @@ class T(TestBase):
) )
# move and remember original contents # move and remember original contents
local_path = os.path.join(self.data.path, 'data/testing/state/results.cache') local_path = os.path.join(self.data.path, 'data/testing/state/autopkgtest-results.cache')
shared_path = os.path.join(self.data.path, 'shared_results.cache') shared_path = os.path.join(self.data.path, 'shared_results.cache')
os.rename(local_path, shared_path) os.rename(local_path, shared_path)
with open(shared_path) as f: with open(shared_path) as f:
@ -2340,7 +2340,7 @@ class T(TestBase):
{'lightgreen': (True, {'lightgreen/3': {'i386': 'PASS', 'amd64': 'PASS'}})}, {'lightgreen': (True, {'lightgreen/3': {'i386': 'PASS', 'amd64': 'PASS'}})},
) )
# leaves results.cache untouched # leaves autopkgtest-results.cache untouched
self.assertFalse(os.path.exists(local_path)) self.assertFalse(os.path.exists(local_path))
with open(shared_path) as f: with open(shared_path) as f:
self.assertEqual(orig_contents, f.read()) self.assertEqual(orig_contents, f.read())

Loading…
Cancel
Save