test_autopkgtest: Strip submit-time

Testsuite regression from 4c27eadffa.

submit-time is the time the request was submitted to amqp. For tests
it's the time the testcase was run. Many of our testcases test the exact
parameters that were passed to amqp, so they now fail because
submit-time is in there but it's not being checked for. It would be
possible to either verify the submit-time too, or switch to fuzzy
matching - but it's actually not very valuable to test submit-time,
since it is only for human readers of autopkgtest-cloud log files or
autopkgtest.ubuntu.com/running.

Instead strip the field from the amqp parameters before any tests see
them.
master
Iain Lane 4 years ago
parent d592ee61ae
commit 177c7a69f7
No known key found for this signature in database
GPG Key ID: E352D5C51C5041D4

@ -171,7 +171,14 @@ class T(TestBase):
try:
with open(self.fake_amqp) as f:
for line in f:
self.amqp_requests.add(line.strip())
# debci-series-amd64:darkgreen {"triggers": ["darkgreen/2"], "submit-time": "2020-01-16 09:47:12"}
# strip the submit time from the requests we're testing; it
# is only for info for people reading the queue
(queuepkg, data) = line.split(' ', 1)
data_json = json.loads(data)
del data_json["submit-time"]
self.amqp_requests.add("{} {}".format(queuepkg,
json.dumps(data_json)))
os.unlink(self.fake_amqp)
except IOError:
pass

Loading…
Cancel
Save