Merge ~andersson123/autopkgtest-cloud:trusty_xenial_amd_64 into autopkgtest-cloud:master

Proposed by Tim Andersson
Status: Merged
Merged at revision: 25e43e5a50bce82902159da42402d055f7bbe05c
Proposed branch: ~andersson123/autopkgtest-cloud:trusty_xenial_amd_64
Merge into: autopkgtest-cloud:master
Diff against target: 43 lines (+25/-0)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker (+25/-0)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+446766@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

Testing it now

Revision history for this message
Brian Murray (brian-murray) wrote :

I think it'd be best to have dictionary of releases and arches as we may need to expand this in the future.

review: Needs Fixing
Revision history for this message
Tim Andersson (andersson123) wrote :

Ready for re-review

Revision history for this message
Tim Andersson (andersson123) wrote :

Forgot to say, amended this morning. Ready for re-review

Revision history for this message
Brian Murray (brian-murray) wrote :

If you have not already, could you run this again in staging and point to the results to demonstrate what the version column now shows? (It had previously shown "trigger:" in the version column which seemed problematic.)

review: Needs Information
Revision history for this message
Tim Andersson (andersson123) wrote :

Hm, I queued it yesterday, seems it's not been absorbed. Will look into it

Revision history for this message
Tim Andersson (andersson123) wrote :

Oh, I have a minor bug, fixing.

Revision history for this message
Tim Andersson (andersson123) wrote :

https://autopkgtest.staging.ubuntu.com/packages/debvm/mantic/amd64

Amended, you can see the test for debvm at 2023-07-19 08:48:50 UTC as an example.

Revision history for this message
Brian Murray (brian-murray) wrote :

I looked at the example run in staging and it looks great, thanks!

I missed this earlier but the check that you are adding is outside of the 'try:' 'finally:' block and the 'finally:' block calls shutil.rmtree(work_dir). Was that change deliberate? If not I think it'd be best if the release and arch check were inside the 'try:' section.

review: Needs Fixing
Revision history for this message
Tim Andersson (andersson123) wrote :

Ah, yes, you're right, good spot. I'll amend

Revision history for this message
Tim Andersson (andersson123) wrote :

Tested, ready for re-review

Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
2index 2af9dc1..980d63b 100755
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker/worker
5@@ -71,6 +71,8 @@ big_packages = set()
6 long_tests = set()
7 never_run = set()
8
9+ARCH_RELEASE_ALLOW_MAPPING = {"trusty": ["amd64"], "xenial": ["amd64"]}
10+
11 FAIL_CODES = (4, 6, 12, 14, 20)
12
13 # In the case of a tmpfail, look for these strings in the log and if they're
14@@ -646,6 +648,29 @@ def request(msg):
15
16 try:
17 out_dir = os.path.join(work_dir, "out")
18+ if (
19+ release.lower() in ARCH_RELEASE_ALLOW_MAPPING
20+ and architecture not in ARCH_RELEASE_ALLOW_MAPPING[release.lower()]
21+ ):
22+ os.makedirs(out_dir)
23+ # these will be written later on
24+ code = 99
25+ duration = 0
26+ logging.info(
27+ f'Only running {",".join(ARCH_RELEASE_ALLOW_MAPPING[release.lower()])} tests for release: {release.lower()}, test requests {architecture}'
28+ )
29+ # fake a log file
30+ with open(os.path.join(out_dir, "log"), "w") as log:
31+ log.write(
32+ f'Only running {",".join(ARCH_RELEASE_ALLOW_MAPPING[release.lower()])} tests for release: {release.lower()}, you have requested {architecture}'
33+ )
34+ with open(
35+ os.path.join(out_dir, "testpkg-version"), "w"
36+ ) as testpkg_version:
37+ testpkg_version.write(
38+ f'Package blacklisted we only run {",".join(ARCH_RELEASE_ALLOW_MAPPING[release.lower()])} tests for {release.lower()}'
39+ )
40+ dont_run = True
41
42 if request_matches_per_package(
43 pkgname, architecture, release, never_run

Subscribers

People subscribed via source and target branches