101 Commits

Author SHA1 Message Date
Martin Pitt
7fc34b1ab6 Autopkgtest: Do not leak full AMQP url to log, it contains a password 2015-12-15 06:43:35 +01:00
Martin Pitt
a4f3abacad Add direct log link to excuses
If we have a result, directly link to the log file on swift in excuses.html.
The architecture name still leads to the package history as before.
If result is still pending, link to the "running tests" page instead.
2015-12-14 16:57:19 +01:00
Martin Pitt
123eb43320 Autopkgtest: Use correct Swift container for ADT_PPAS
When using ADT_PPAS, the results won't go into the "autopkgtest-%SERIES"
container but into the PPA specific "autopkgtest-%SERIES-LPUSER-PPANAME" one.
2015-12-14 10:58:02 +01:00
Martin Pitt
6d0c3a1fa6 Autopkgtest: Keep the actual run IDs
Don't clobber passed run IDs with newer failed results. This is potentially a
bit more expensive as we might re-fetch failed results at every run after a
PASS, but the IDs in our cache will be correct so that we can expose them in
the UI.
2015-12-08 14:17:58 +01:00
Martin Pitt
ea1c335992 Autopkgtest: Simplify test request and result retrieval workflow
Splitting up the processes of request(), submit(), and collect() makes our data
structures, house keeping, and code unnecessarily complicated. Drop the latter
two and now do all of it in just request(). This avoids having to have a
separate requested_test map, having to fetch test results twice, and gets rid
of some state keeping.
2015-12-01 23:57:52 +01:00
Martin Pitt
f94c2c0ade Autopkgtest: Drop trigger argument from fetch_swift_results()
This could have led to (re-)fetching results more than once when we only got
the latest ID from the few triggers we were currently looking at, not for all
possible triggers of a package. Drop this kludge, and replace it with a proper
full iteration and caching.
2015-12-01 23:05:00 +01:00
Martin Pitt
ba77e95c04 Autopkgtest: Reorganize pending test maps
- Invert the map to go from triggers to tested packages, instead of the other
   way around. This is the lookup and update mode that we usually want, which
   simplifies the code and speeds up lookups. The one exception is for fetching
   results (as that is per tested source package, not per trigger), but there
   is a FIXME to get rid of the "triggers" argument completely.

 - Stop tracking tested package versions. We don't actually care about it
   anywhere, as the important piece of data is the trigger.

 - Drop our home-grown pending.txt format and write pending.json instead.

ATTENTION: This changes the on-disk cache format for pending tests, so
pending.txt needs to be cleaned up manually and any pending tests at the time
of upgrading to this revision will be re-run.
2015-12-01 15:20:40 +01:00
Martin Pitt
b426244840 Autopkgtest: Reorganize results map
- Invert the map to go from triggers to tested versions, instead of from
   tested versions to triggers. This is the lookup and update mode that we
   usually want (except for determining "ever passed"), thus this simplifies
   the code and speeds up lookups.

 - Drop "latest_stamp" in favor of tracking individual run IDs for every
   result. This allows us in the future to directly expose the run IDs on
   excuses.{yaml,html}, e. g. by providing direct links to result logs.

 - Drop "ever_passed" flag as we can compute this from the individual results.

 - Don't track multiple package versions for a package and a particular
   trigger. We are only interested in the latest (passing) version and don't
   otherwise use the tested version except for displaying.

This requires adjusting the test_dkms_results_per_kernel_old_results test, as
we now consistently ignore "ever passed" for kernel tests also for "RUNNING"
vs.  "RUNNING-ALWAYSFAILED", not just for "PASS" vs. "ALWAYSFAIL".

Also fix a bug in results() when checking if a test for which we don't have
results yet is currently running: Check for correct trigger, not for the
current source package version. This most probably already fixes LP: #1494786.
Also upgrade the warning about "result is neither known nor pending" to a grave
error, for making it more obvious to debug remaining errors with this.

ATTENTION: This changes the on-disk format of results.cache, and thus this
needs to be dropped and rebuilt when rolling this out.
2015-12-01 11:50:16 +01:00
Martin Pitt
ca8bd037b0 Rename state RUNNING-ALWAYSFAILED to RUNNING-ALWAYSFAIL
This is consistent with the other "ALWAYSFAIL" state.
2015-12-01 11:48:51 +01:00
Martin Pitt
5714690df4 autopkgtest.py: Drop unused function 2015-12-01 08:39:10 +01:00
Martin Pitt
400f4087bb Add ADT_PPAS option for adding PPAs to autopkgtest requests
For using britney on PPAs we need to add the "ppas" test parameter to AMQP
autopkgtest requests. Add ADT_PPAS britney.conf option which gets passed
through to test requests.
2015-11-30 10:17:04 +01:00
Martin Pitt
2ebfc0bb8f Stop accepting results without recorded trigger
In situations where we don't have an up to date existing results.cache, the
fallback for handling test results would attribute old test results to new
requests, as we don't have a solid way to map them. This is detrimental for ad
hoc britney instances, like for testing PPAs, and also when we need to rebuild
our cache.

Ignore test results without a package trigger, and drop the code for handling
those.

The main risk here is that if we need to rebuild the cache from scratch we
might miss historic "PASS" results which haven't run since we switched to
recording triggers two months ago. But in these two months most of the
interesting packages have run, in particular for the development series and for
stable kernels, and non-kernel SRUs are not auto-promoted anyway.
2015-11-27 16:36:28 +01:00
Martin Pitt
f4a199a300 Move from kombu to amqplib
python3-amqplib already exists in trusty, but python3-kombu does not. This
makes it possible to run britney on a standard trusty without manual backports.
2015-11-27 08:16:55 +01:00
Iain Lane
8f70520823 autopkgtest: Don't repeat "ever_passed" check
We can just add a default value  before the "try" block and then use that as
the default (no results) case.
2015-11-24 14:58:55 +00:00
Didier Roche
611760e996 Match as well sent token to ALWAYSFAILED 2015-11-23 14:20:04 +01:00
Iain Lane
289ea7b687 Don't wait for tests which have never passed
They won't ever block promotion, so we might as well make them
candidates right away (but trigger their tests).
2015-11-18 14:38:36 +00:00
Martin Pitt
6e8ddbb7c4 Split self.options.adt_arches once during initialization
For consistency with all other self.options.*_arches.
2015-11-17 09:15:31 +01:00
Martin Pitt
4c23b25ce2 Autopkgtest: Request one test run per trigger for all packages
Stop special-casing the kernel and move to one test run per trigger. This 
allows us to only install the triggering package from unstable and run the rest
out of testing, which gives much better isolation.
2015-11-06 16:12:01 -06:00
Martin Pitt
1a4a37cb02 Let linux-meta trigger systemd 2015-10-29 22:21:13 +01:00
Martin Pitt
0e3434ddbd Autopkgtest: Make has_autodep8 a class method
So that we can use it without having to instantiate a full AutoPackageTest
object.
2015-10-19 12:01:32 +02:00
Martin Pitt
445e33e9e0 Stop triggering tests by linux, move to -meta
For linux* themselves we don't want to trigger tests -- these should all come
from linux-meta*. A new kernel ABI without a corresponding -meta won't be
installed and thus we can't sensibly run tests against it. This caused
unnecessary and wrong regressions, and unnecessary runs (like linux-goldfish
being triggered by linux).
2015-10-09 17:22:21 +02:00
Martin Pitt
ee7859ea0e Autopkgtest: Don't trigger tests for alternative gcc-*
Sources like gcc-snapshot or gcc-4.7 are not the default compiler any more and
thus triggering kernels etc. is just a waste.
2015-10-08 11:03:39 +02:00
Martin Pitt
0a72e94198 Autopkgtest: Don't re-run passed test results
Test requesting: Don't re-request a test if we already have a result for it for
that trigger (for a relevant version), but there is a new version of the tested
package. First this unnecessarily delays propagation as the test will go back
to "in progress", and second if it fails in the next run this isn't the fault
of the original trigger, but the new version of the tested package.

Result finding: Don't limit acceptable results to the latest version of the
tested package. It's perfectly fine if an earlier version (like the one in
testing, or an earlier upload) was ran and gave a result for the requesting
trigger. If it's PASS, then we are definitively done, and if it's a failure
there is the "Checking for new results for failed test..." logic in collect()
logic which will also accept newer results.
2015-10-07 15:55:46 +02:00
Martin Pitt
a9bef9c574 Code layout/copyright fixes
Sort the tests into different categories with comment headers. Bump copyright
years.
2015-10-07 08:49:47 +02:00
Martin Pitt
632f542e63 Autopkgtest: Don't track "ever passed" for kernel triggers, part 2
In addition to not reading ever_passed for kernel triggers, we must also not
write it for those. Otherwise we introduce false regressions for e. g. "dkms"
when some DKMS package always failed on the main kernel but succeeds on one
flavour.
2015-09-30 17:45:12 +02:00
Martin Pitt
30b6af1175 Autopkgtest: Don't track "ever passed" for kernel triggers
We trigger independent tests for every linux/linux-meta* reverse dependencies,
as they run under the triggering kernel. Thus "ever passed" is rather
meaningless for these as we don't want to track this on a per-trigger basis (as
it would be wrong for everything else but kernels). This led to a lot of false
regressions, as some DKMS modules only work on some kernel flavours.

The kernel team is doing per-kernel regression analysis of the test results, so
we don't need to duplicate this logic in britney. Thus effectively disable the
"Regression" state for kernel reverse dependencies, and rely on the kernel
test machinery to untag the tracking bug only if there are no actual
regressions.
2015-09-29 21:42:05 +02:00
Martin Pitt
2ba7fd223c Autopkgtest: Trigger LXC from linux only on valid architectures
If the linux source package does not build any binaries on the given
architecture, don't trigger an LXC test for it.
2015-09-23 15:35:37 +02:00
Martin Pitt
effdc25263 autopkgtest.py: Drop unused itertools 2015-09-21 16:30:12 +02:00
Martin Pitt
622115a2fb Autopkgtest: Fix updating results with explicit triggers
When fetching a result with explicit triggers, always update self.results, not
just when we have a pending trigger for it. Otherwise satisfied_triggers will
be empty after reading the first result, and we clobber test results for all
triggers with the latest result.
2015-09-21 16:27:49 +02:00
Martin Pitt
9b70fe361d Autopkgtest: Collect results for requested tests before submitting
When we need to blow away and rebuild results.cache we want to avoid
re-triggering all tests. Thus collect already existing results for requested
tests before submitting new requests.

This is rather hackish now, as fetch_one_result() now has to deal with both 
self.requested_tests and self.pending_tests. The code should be refactored to
eliminate one of these maps.
2015-09-18 06:47:28 +02:00
Martin Pitt
19cd69cb47 Autopkgtest: Track/cache results by triggering package
When downloading results, check the ADT_TEST_TRIGGERS var in testinfo.json to
get back the original trigger that previous britney runs requested the test run
for. This allows us to much more precisely map a test result to an original
test request.

In order to tell apart test results which pass/fail depending on the package
which triggers them (in particular, if that is a kernel), we must keep track of
pass/fail results on a per-trigger granularity. Rearrange the results map
accordingly.

Keep the old "latest test result applies to all triggers of this pkg/version"
logic around as long as we still have existing test results without
testinfo.json.

ATTENTION: This breaks the format of results.cache, so this needs to be removed
when rolling this out.
2015-09-18 06:46:34 +02:00
Martin Pitt
0eddac8476 Autopkgtest: Trim triggered tests for gccgo-5
gccgo-5 exists in Ubuntu 15.04 only and builds all binary packages of gcc-5.
Triggering all tests is pointless and a big waste of test resources, so trim
down the list to actually useful ones. This can be dropped when 15.04 goes EOL.
2015-09-18 06:43:39 +02:00
Martin Pitt
775274ca89 Autopkgtest: Ignore results without package/version
We often get "tmpfail" results (repeated failure to start cloud instance, etc.)
with no package/version at all. Stop attributing them to the latest pending
request for that package, as that has already messed up some results. With
moving to tracking test triggers in testinfo.jar and running multiple test
requests for each triggering kernel version it becomes completely impossible to
interpret anything into a tmpfail result without testpkg-version, so just
ignore them.

This will leave some orphaned entries in pending.txt and thus require manual
retries after fixing the tmpfail reason. But this needs to happen anyway, so
this does not complicate operation but instead shows those as "in progress"
instead of "regression".
2015-09-17 12:31:13 +02:00
Martin Pitt
6af2e9c1dc Autopkgtest: Include triggering package version in test request params
So far we only added the triggering test name. Add the version as well, so that
we'll retain the complete trigger information in result.tar's testinfo.json in
swift. This will allow us to completely reconstruct our results.cache from
scratch without losing any trigger information.

This isn't significantly harder to parse from shell either (in tests): You can
still iterate over $ADT_TEST_TRIGGERS with a "for" loop and split package and
version on '/'.
2015-09-17 11:56:29 +02:00
Martin Pitt
50673de2d8 autopkgtest: Check for new results on a per-architecture granularity
In collect(), check if there are new results for failed tests on a
per-architecture level. This updates results while tests for other
architectures are still in progress (i. e. in self.pending_tests).
2015-09-17 09:32:35 +02:00
Martin Pitt
49260078e4 autopkgtest: Make Linux -> DKMS triggering arch specific
Only trigger DKMS tests for architectures on which the given kernel actually
exists.
2015-09-16 22:59:05 +02:00
Martin Pitt
76751fff88 autopkgtest: Make tests_for_source() arch specific
So far we've only calculated the reverse dependencies on amd64. This breaks
when triggering packages which do not exist on some architectures, like
bcmwl-kernel-source. It also makes it impossible to e. g. trigger DKMS tests on
armhf only for an ARM-only kernel like linux-ti-omap4.
2015-09-16 17:07:19 +02:00
Martin Pitt
21fec5d92a Only trigger autopkgtests for some key packages for gcc-*
Through the usual reverse dependency triggering, gcc-* usually triggers many
hundreds of (mostly universe) tests via libgccN. But:

 - This does not help to prevent compiler regressions: as all packages are
   built in -proposed anyway, the new compiler is being used immediately, so we
   can't hold it back in -proposed.

 - It does not trigger toolchain tests which actually are affected, most
   importantly binutils and linux.

 - This puts enormous stress onto our test infrastructure.

So special case gcc by triggering binutils and linux, and fglrx-installer as a
typical (and important) example of a DKMS package which also needs a compiler,
and libreoffice as our favourite tool chain stress test to cover libgccN.
2015-09-16 08:03:17 +02:00
Martin Pitt
6591d67c47 autopkgtest: Trigger lxc tests from linux-meta*, not linux
This is more consistent with the DKMS triggers, and will make things easier for
the kernel status matrix.
2015-09-15 15:10:49 +02:00
Martin Pitt
2aa0948250 autopkgtest: Request separate tests for linux-meta* triggers
If a package gets triggered by several sources, we can ordinarily run just one
test for all triggers. But for proposed kernels we want to run a separate test
for each, so that the test can run under that particular kernel.
2015-09-14 16:07:44 +02:00
Martin Pitt
16f4d7c8b2 AutoPackageTest.submit(): Factor out calculation of requests 2015-09-14 15:51:46 +02:00
Martin Pitt
90596ff8b0 autopkgtest: Include triggering packages in AMQP requests
With this, tests can do special things when they get triggered by a particular
package. E. g. "linux" or "gcc" could skip their "rebuild myself" test if they
were triggered by a new version of themselves (as opposed to a new binutils).
This is particularly aimed at DKMS tests which need to install the triggering
kernel (e. g. -generic vs. -generic-lts-backport-XXX).
2015-08-31 14:30:07 +02:00
Martin Pitt
c195f87ba5 autopkgtest: Trigger lxc tests for linux updates
New kernels are prone to break LXC. In https://bugs.debian.org/779559 there is
a proposal for a flexible approach to add extra "reverse test dependencies".
Hardcode this trigger until this gets implemented.
2015-08-28 06:58:12 +02:00
Martin Pitt
ec83f7aaff autopkgtest: Trigger DKMS packages for linux-meta-* backports too 2015-08-28 06:44:12 +02:00
Martin Pitt
78aa12994c autopkgtest: Trigger DKMS packages for new linux-meta uploads
By the kernel team's request we want to trigger DKMS package tests on new
kernel uploads, to ensure that we don't regress them with newer kernels.

Pretend that linux-meta builds the "dkms" binary, so that the existing reverse
dependency magic takes care of the actual triggering.

Note that this needs to be "linux-meta", not "linux", so that tests will
actually use the new kernel (via dist-upgrade).
2015-08-26 16:24:13 +02:00
Martin Pitt
71b07bc66a Add structured test results to Excuse objects
Add Excuse.addtest() for adding a test type/package/arch/result, so that the
excuses YAML will get structured test results instead of pre-formatted HTML.
Move the HTML rendering into Excuse.html() instead.

This supports a "test type" whose only value is "autopkgtest" right now, but
we will have "bootest", perhaps "piuparts" and other tests in the future.

Drop the "(<ver> is unbuilt/uninstallable)" note from excuses.html as this is
really a per-architecture property, not a per-tested-source one. This needs to
be re-thought and generalized.
2015-08-25 12:21:51 +02:00
Martin Pitt
32f33baf09 Merge with trunk, port to Python 3 2015-08-24 20:46:42 +02:00
Martin Pitt
c59033afae autopkgtest: Check for existing test results for unstable version too
r472 added >= version matching to the results evaluation. But we also must do
this in add_test_request() so that we avoid requesting a test for the testing
version over and over again if we get results for the unstable version only.
But here it is enough to only check the requested version and the unstable
version (if that's higher).
2015-08-24 10:58:27 +02:00
Martin Pitt
6db26ca1c6 autopkgtest: Don't cache results for undefined versions
If a result.tar does not contain a testpkg-version, we must still match it
against pending.txt, but we must not add it to the results cache. This ends up
being a "null" version key (JSON's serialization of None) which becomes an
actual version string once this is read back.
2015-08-18 22:53:14 +02:00
Martin Pitt
380e3fca64 autopkgtest: Check for test results from newer package version than the requested one
There are scenarios when britney requests a package test for a particular
version but we actually get a result for a later version:

 * When britney runs the later version is not built yet and thus it is in
   excludes; but at the time when the test actually runs the package is built.

 * We don't support running tests for a given older (source) version yet, tests
   always get run from the latest unstable source even if that isn't built yet.

Thus we need to consider results >= the requested version. However, we prefer a
succesful result for the originally requested version so that we can continue
to remove a broken version from unstable. This is already covered by
TestAutoPkgTest.test_remove_from_unstable.
2015-08-17 21:55:18 +02:00