856 Commits

Author SHA1 Message Date
Martin Pitt
ffe0a99db1 swift result download: Correctly handle "204 No content" status 2015-07-14 08:34:46 +02:00
Martin Pitt
cb66355e95 Comment ADT_AMQP and ADT_SWIFT_URL config options
Their default values are invalid and must be set locally. But as
britney1-ubuntu copies these into production, we would run with an invalid
config with an unmodified config file.
2015-07-14 07:55:30 +02:00
Steve Langasek
13a3ec2593 Merge lp:~pitti/britney/britney2-ubuntu-swiftresults 2015-07-13 08:39:55 -07:00
Martin Pitt
ce775eeb5d Add test results from swift
Until now, autopkgtest results were triggered via an external "adt-britney"
command from lp:auto-package-testing. This required a lot of state files and
duplicated effort, uses hardcoded absolute paths to these external tools, and
is quite hard to understand and maintain. We also want to move away from
Jenkins and rsyncing state files.

Directly retrieve autopkgtest results from a publicly readable and browsable
Swift container, with a debci-compatible layout
(https://wiki.debian.org/debci/DistributedSpec). This now tracks both requests
and results on a per-architecture granularity, so that we can track
per-architecture regressions/always-failed.

Introduce a new ADT_SWIFT_URL config option that sets the swift base URL. If
this key is not set, the behaviour does not change compared to previous
versions, and no results will be retrieved from the cloud.

This still keeps the old adt-britney requests/results as the authoritative
data and for now merely shows the swift results in addition. With that we can
compare the results and run the cloud testing in parallel to find/fix problems
until we switch over. Due to that, the code to britney.py is temporary, does
*not* use AutoPackageTest.results(), and instead just reads the internal
results map.
2015-07-10 06:21:46 +02:00
Martin Pitt
37cd90b415 Add mock swift server
This can be loaded with a predefined set of results, and will then act like a
Swift server with publicly accessible and browsable containers.
2015-07-07 17:45:16 +02:00
Martin Pitt
6e167a0343 Track architectures in requested/pending tests
This is necessary so that we can properly match requested to received results
when the latter arrive in different runs for different architectures.

This also opens up the possibility of per-arch blacklisting later.
2015-07-07 11:59:07 +02:00
Martin Pitt
bf470c6da0 Use current reverse dep version instead of None/-
This makes tracking test results easier and removes some special cases.
2015-07-07 11:11:44 +02:00
Martin Pitt
ded6912443 Add autopkgtest test case for a package pair 2015-07-07 09:10:58 +02:00
Martin Pitt
9c59f35af4 AutoPkgTest.tests_for_source(): Avoid reporting duplicate results 2015-07-07 08:05:19 +02:00
Steve Langasek
2f9f5fd0eb Merge lp:~pitti/britney/britney2-ubuntu-amqp 2015-07-06 09:23:02 -07:00
Martin Pitt
49500104ae AutoPkgTest.tests_for_source(): Don't trip over NBS binaries 2015-07-06 15:02:21 +02:00
Martin Pitt
e0c4ec15b6 AutoPkgTest.update_pending_tests(): Reset self.requested_tests after merging into self.pending_tests 2015-07-06 11:31:21 +02:00
Martin Pitt
cc1bd60d19 Factor out "tests for source package" calculation 2015-07-06 10:24:51 +02:00
Martin Pitt
4dc0d388d3 add ADT_AMQP option to britney_nobreakall.conf too 2015-07-06 08:03:49 +02:00
Martin Pitt
73bb510389 autopkgtest.py: Clarify comments where the "pending tests" state file lives 2015-07-03 07:35:41 +02:00
Martin Pitt
d5181ef32a autopkgtest AMQP: Don't declare queues
Don't use kombu's SimpleQueue() as that always declares queues and we neither
want that (we want to know when we try to talk to a nonexisting queue), nor
might the RabbitMQ ACL allow us to do that. So use kombu.Producer without queue
declaration.
2015-07-03 07:35:00 +02:00
Martin Pitt
335073e901 Add requesting tests through AMQP
Until now, autopkgtests were triggered via an external "adt-britney" command
from lp:auto-package-testing. This duplicated a lot of effort (such as its own
chdist and reverse dependency calculation), maintains a lot of state files,
uses hardcoded absolute paths to these external tools, and is quite hard to
understand and maintain. We want to get rid of all this.

Add logic to AutoPackageTest.request() to use britney's existing reverse
dependency maps and figure out the set of tests to run for packages in
unstable. These are being tracked in "requested_tests".

Add logic to AutoPackageTest.submit() to send test requests to the AMQP server
specified in the new "ADT_AMQP" config key. For testing this can be a file://
URL, and if not set no test requests will be sent at all.

The set of tests which were requested in previous runs are tracked in
UNSTABLE/autopkgtest/pending.txt, so that we don't re-request tests in
subsequent runs.

There is no implementation for collect() and results() yet, these will be done
in a separate commit.

Add initial test cases.
2015-07-02 17:41:49 +02:00
Martin Pitt
a3a523b4ed autopkgtest.py: Factorize logging into helper methods 2015-07-02 17:36:23 +02:00
Martin Pitt
65a1d73164 tests: Don't touch original britney.conf
Don't change britney.conf from the source tree and restore it back after the
tests; this is prone to leave a broken config behind if a test gets
interrupted. Instead, copy the file to our temp dir, and let tests hack on it
there.

(Introduced in lp:~canonical-ci-engineering/britney/boottesting-support)
2015-07-02 16:24:53 +02:00
Martin Pitt
add46d2904 Store autopkgtest flag in sources
Extend read_sources to store a new AUTOPKGTEST boolean flag, which is true if
the Testsuite: field exists and starts with "autopkgtest" (this covers autodep8
cases like autopkgtest-pkg-perl).

Extend TestData.add() to take a new testsuite argument which specifies the
source's Testsuite: field.
2015-07-01 15:49:06 +02:00
Steve Langasek
6b775c50f3 Merge lp:~canonical-ci-engineering/britney/enable-vivid-boottest 2015-06-12 13:56:44 -07:00
Francis Ginther
9e238f7406 For selection of boottest candidates, use a list of url formats for downloading the appropriate touch image manifest for a given release. 2015-06-08 10:25:34 -05:00
Francis Ginther
ca1fc41f9e Refactor the __fetch_manifest() code so that the a successful response is immediately handled and we don't end up with an undefined 'response' on an exception. Also update the tests to return two mocked reponses to match the size of the url_list. 2015-06-05 11:08:48 -05:00
Francis Ginther
7e38fec3cb Use a list of url formats for downloading the appropriate touch image manifest for a given release. 2015-06-04 22:12:18 -05:00
Niels Thykier
8f27919cf8 Create a clone_nuninst function for iter_packages{,_hint}
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
4d218df7d0 iter_pkg: Refactor nuninst cloning
Move nuninst cloning out of the check loop and always populate the new
nuninst entirely.

This will allow some simplifications in other places.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
ffcfa8e27e britney.py: Avoid some O(n) look-ups in the auto-hinter
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
cc58511c09 Avoid O(n^2) duplication handling when building hints
Use a set to filter out seen items to avoid doing O(n^2)
de-duplication.  For very large hints, this can take considerable
time.

Using "seen_items" to build the actual hints on the (unverified)
assumption that Python can do something "smart" to turn a set into a
frozenset faster than it can with a list.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
754688851a britney: Optimise original auto-hinter duplication handling
Britney is now smart enough to produce the same result from hints
regardless of the order of the items in the hint.  With this in mind,
we can have the original auto-hinter produce hints as sets and filter
out duplicates as we produce them.

Note that the hints are sorted to produce deterministic output (to
make it easier to compare the hints between runs and changes).

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
e45b219276 britney.py: Pre-split self.options.*_arches
We always use them as lists, so we might as well just split them once
and be done with it.
2015-06-02 21:33:52 +02:00
Niels Thykier
e4c7c4f2a2 britney.py: Minor optimisation to sort_actions
Avoid some cases of O(n^2) behaviour in sort_actions and reduce the
size of n for the remaining O(n^2)-ish behaviour by filtering out
removals early on.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
d7baa1d7f0 britney.py: Remove redundant arg to format
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:51 +02:00
Niels Thykier
bdcf4e826b Be verbose when rejecting a hint due to invalid candidates
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:51 +02:00
Niels Thykier
35e5742d85 Remove "leading" from hints - it provides no new information 2015-06-02 21:33:51 +02:00
Niels Thykier
375b468512 Remove unused local variable
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:29:47 +02:00
Niels Thykier
06a45f2ed4 britney_util: Typo fix
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:29:47 +02:00
Adam D. Barratt
1d98bf293d britney.py: reverse sense of tests for architecture-indep packages
It's more natural to say "check this package if the current arch is in
this list" than "do not check this package if the current arch is not
in this list"

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2015-04-27 19:43:54 +00:00
Adam D. Barratt
18885d3f3b britney.py: typo fixes
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2015-04-27 19:14:08 +00:00
Adam D. Barratt
d8fa67cee8 britney.py: drop inaccurate comment
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2015-04-27 18:50:48 +00:00
Niels Thykier
7a53010adc britney.conf: Renable smooth updates for libs+oldlibs 2015-04-26 19:45:28 +02:00
Anthony Towns
efe5c82f22 britney: Take more care with hijacked binaries
This updates the doop_source and _compute_groups functions so
that binary packages that are built from a different source
aren't included as part of an update to the original source.
In the event that it's a binary-only update, also don't remove
the hijacked packages from testing.

This change also removes an obsolete comment regardarding pre-conditions
for the _compute_groups function.
2015-04-26 18:20:11 +02:00
Niels Thykier
98070388e7 britney.py: Enable the new consistency checks by default
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
ed91345c06 britney.py: Skip ESSENTIAL consistency check
The live-data tests rely on an inconsistency, since they were before
Britney started to record the Essential field.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Anthony Towns
06df61849e britney: Check for mismatched packages between suites.
britney assumes that a package build is uniquely described by its
name, version and architecture. Particularly when constructing
Packages files by hand for testing purposes this assumption can be
violated, leading to confusing behaviour. This change makes britney
look for such mismatches, and report if any are found.
2015-04-26 18:20:11 +02:00
Niels Thykier
f6c653b3f5 inst-tester: Fix bug "choices" would not be updated
In some scenarios, it was possible to trigger a bug in the
installability tester, where it would fail to update the "choices" set.
The requirements for triggering this seems to be something like:

 * Obtain a choice that is possible to solve.
 * Resolve the choice without recursing (with a backtrack point)
 * Obtain a second choice that is impossible to solve.

After the two first steps, the installability tester would fail to
update the "choices" set (or, rather, changes would be invisible to
the "_pick_choice" function).  Fortunately, most packages are either
trivially installable or trivially uninstallable, so the bug seems to
be rather rare if triggred at all.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
082139f4e3 Collect more statistics from the installability tester
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
222f7114fc Compute simple stats installability tester graph
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
9ace17b38a solver.py: Remove unused import
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
bd5b3ac4ec Remove unused assignments/parameters
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
a5aad84699 britney.py: Remove trailing semi-colons
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:10 +02:00