Merge lp:~jibel/britney/do_not_test_untestable_packages into lp:~ubuntu-release/britney/britney2-ubuntu

Proposed by Jean-Baptiste Lallement
Status: Merged
Merged at revision: 383
Proposed branch: lp:~jibel/britney/do_not_test_untestable_packages
Merge into: lp:~ubuntu-release/britney/britney2-ubuntu
Diff against target: 62 lines (+23/-2)
2 files modified
autopkgtest.py (+20/-1)
britney.py (+3/-1)
To merge this branch: bzr merge lp:~jibel/britney/do_not_test_untestable_packages
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+193107@code.launchpad.net

Commit message

Remove packages from the request file that are not valid for testing i.e excuse.run_autopkgtest = False.

Description of the change

This proposition of patch removes packages from the request file that have been identified by britney as invalid for testing.

For example package A is autopkgtest-able but FTBFS on i386 and depends on package B.
Britney identifies A as non-testable (excuse.run_autopkgtest = False) when B is uploaded it shouldn't start a test of A.
If test A starts, it will either fail or pass but test the wrong version and reconciliation of the test submission with the result will not be possible.

The case where a package is uploaded and not testable is already handled by britney.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This makes sense, on the grounds that once A later becomes a valid candidate it'll have its autopkgtests run then.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopkgtest.py'
2--- autopkgtest.py 2013-10-20 21:29:00 +0000
3+++ autopkgtest.py 2013-10-29 17:27:56 +0000
4@@ -128,7 +128,10 @@
5 command.extend(args)
6 subprocess.check_call(command)
7
8- def request(self, packages):
9+ def request(self, packages, excludes=None):
10+ if excludes is None:
11+ excludes = []
12+
13 self._ensure_rc_file()
14 request_path = self._request_path
15 if os.path.exists(request_path):
16@@ -140,6 +143,22 @@
17 print("%s %s" % (src, ver), file=request_file)
18 request_file.flush()
19 self._adt_britney("request", "-O", request_path, request_file.name)
20+
21+ # Remove packages that have been identified as invalid candidates for
22+ # testing from the request file i.e run_autopkgtest = False
23+ with open(request_path, 'r') as request_file:
24+ lines = request_file.readlines()
25+ with open(request_path, 'w') as request_file:
26+ for line in lines:
27+ src = line.split()[0]
28+ if not src in excludes:
29+ request_file.write(line)
30+ else:
31+ if self.britney.options.verbose:
32+ print("I: [%s] - Requested autopkgtest for %s but "
33+ "run_autopkgtest set to False" %
34+ (time.asctime(), src))
35+
36 for linebits in self._parse(request_path):
37 # Make sure that there's an entry in pkgcauses for each new
38 # request, so that results() gives useful information without
39
40=== modified file 'britney.py'
41--- britney.py 2013-10-04 23:51:26 +0000
42+++ britney.py 2013-10-29 17:27:56 +0000
43@@ -1684,8 +1684,10 @@
44 self, self.options.adt_series, debug=adt_debug)
45 autopkgtest_packages = []
46 autopkgtest_excuses = []
47+ autopkgtest_excludes = []
48 for e in self.excuses:
49 if not e.run_autopkgtest:
50+ autopkgtest_excludes.append(e.name)
51 continue
52 # skip removals, binary-only candidates, and proposed-updates
53 if e.name.startswith("-") or "/" in e.name or "_" in e.name:
54@@ -1694,7 +1696,7 @@
55 continue
56 autopkgtest_excuses.append(e)
57 autopkgtest_packages.append((e.name, e.ver[1]))
58- autopkgtest.request(autopkgtest_packages)
59+ autopkgtest.request(autopkgtest_packages, autopkgtest_excludes)
60 if not self.options.dry_run:
61 autopkgtest.submit()
62 autopkgtest.collect()

Subscribers

People subscribed via source and target branches