137 Commits

Author SHA1 Message Date
Iain Lane
7718350053 Fix typo in test name triggerered -> triggered 2015-11-18 13:36:31 +00:00
Iain Lane
28fd7f5d6d tests: pretty print the excuses so that they are readable 2015-11-18 13:36:23 +00:00
Iain Lane
41da740a98 Add passing results for various tests
We're going to modify britney so that RUNNING tests don't block
promotion if they have never failed - for this we will need to change a
few tests so that the packages being tested have passed before, meaning
that there could potentially be a regression.
2015-11-18 13:36:09 +00:00
Martin Pitt
68b5366d1b tests: Use proper triggers in all tests
Also introduce a tr() shortcut for those. Drop the now redundant
test_rerun_failure_triggers().
2015-11-06 16:51:55 -06: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
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
1ab16725df Make linux* wait on corresponding -meta package
We want to treat linux-$flavor and linux-meta-$flavor as one set in britney
which goes in together or not at all. We never want to promote linux-$flavor
without the accompanying linux-meta-$flavor.

Introduce a synthetic linux* → linux-meta* dependency to enforce this grouping.
2015-10-08 08:26:59 +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
6e2f3dbf2a Autopkgtest tests: Consistently make green have an autopkgtest
This was a confusing inconsistency: libgreen1 and green binaries are both built
from the "green" source, so they should consistently declare that they have
"Testsuite: autopkgtest". Adjust the tests accordingly.
2015-10-07 09:07:38 +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
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
97da2de23f Autopkgtest: Add test case for re-running failed tests with different triggers 2015-09-29 17:40:45 +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
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
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
4df8700f8b tests/mock_swift.py: Support adding testinfo.json 2015-09-17 11:05:33 +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
d10763c1f9 Autopkgtest tests: Publish test packages on all architectures by default
This is a prerequisite for introducing per-architecture test calculation.
2015-09-16 16:49:14 +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
fa389b2e53 tests/mock_swift.py: Fix ResourceWarning due to unclosed log file 2015-09-14 15:15:37 +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
0dfde694a9 make tests/test_* executable 2015-08-26 15:29:49 +02:00
Martin Pitt
39dc24ec71 Change autopkgtest tests to check YAML instead of HTML
Matching the HTML for regexps does not work reliably when we have multiple
unstable packages of which only some are valid candidates but others aren't. It
also imposes a too strict test on the particular formatting when we are only
interested in the actual data and structure.

So move towards checking the machine parseable YAML instead and read that into
a proper Python dict.

This exposed a bug uncovered by test_rdepends_unbuilt() which we previously
missed because we couldn't check triggered tests per package.
2015-08-25 17:11:14 +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
66f6a066d2 Use only i386 and amd64 for autopkgtest tests 2015-08-25 11:46:33 +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
faa375dc53 autopkgtest tests: some more assertions 2015-08-24 07:30:22 +02:00
Martin Pitt
49b2a65a9c autopkgtest tests: Always reset self.amqp_requests
Unlink self.fake_amqp in do_test() instead of individually in test cases, as we
always want to verify the requests from the last run only, not the accumulated
requests.
2015-08-24 07:18:20 +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
Martin Pitt
e85c59b46a Always require ADT_{AMQP,SWIFT_URL} with ADT_ENABLE
Disabling AMQP requests with "ADT_ENABLE = yes" but ADT_AMQP unset made sense
while we still supported adt-britney. But as that's gone now, let's use the
ADT_ENABLE switch only, and if it's on, require ADT_AMQP and ADT_SWIFT_URL be
set.

This simplifies the code a bit and is less confusing.
2015-08-14 09:54:18 +02:00
Martin Pitt
42e1ac635d Autopkgtest.request(): Don't ignore excluded packages
We already handle the exclusions in tests_for_source() (and run the testing
version if appropriate), so don't unconditionally skip requests for those.

Adjust the TestAutoPkgTest.test_rdepends_unbuilt case to catch that: The "run
britney once to pick up previous results" was a thinko as this already
satisfies all tests for green 2.
2015-08-14 09:39:26 +02:00
Martin Pitt
6c3dd0a3e2 Fix KeyError crash for sources which are only in unstable
The previous commit introduced a KeyError crash in tests_for_source() for
packages which are unbuilt/uninstallable and only present in unstable.

Ignore these in tests_for_source() as they can't possibly be a regression for
their dependencies, and there is no sensible way to run a test for them.
2015-08-13 09:36:47 +02:00
Martin Pitt
c9173b3ca3 Promote packages with unbuilt reverse dependencies if testing version succeeds
Commit 463 ("Don't promote packages with unbuilt reverse dependencies") turned
out to be too strict: This holds up too many innocent packages in -proposed.

If unstable has an unbuilt/uninstallable reverse dependency D of a package P,
trigger a test anyway (which will then most likely run against the testing
version of D). If that succeeds, the unstable P did not break D and can be
accepted. If it fails, D needs to be fixed.

Ideally we would set up some clever apt pinning to force installation of
testing-D, to avoid running into the uninstallability of unstable-D, but this
is tricky and error prone.

Drop the temporary "UNINST" state from commit 466 again. Instead, excuses.html
will now show a test against the testing version of D together with a note that
the unstable version is unbuilt/uninstallable.

This should ideally clear up all cases where a requested result is neither
present or pending. Log an error if that still happens (will be checked in the
next couple of runs), and ensure in the tests that we don't trigger any
outstanding "FIXME" log messages.
2015-08-13 08:31:55 +02:00
Martin Pitt
65c6e4df2a Clarify status of excluded reverse dependencies
Commit 463 introduced waiting on reverse dependencies which are not built or⎵
installable yet, but set their status as "RUNNING". This is confusing as there
is no actual test in progress yet.

Instead, set their status to a new UNINST value, displaying as⎵
"Unbuilt/uninstallable"
2015-08-12 16:52:15 +02:00
Martin Pitt
191025cacd tests/mock_swift.py: Properly wait for server to start 2015-08-12 16:44:33 +02:00
Martin Pitt
ca9987def8 Don't promote packages with unbuilt reverse dependencies
If a reverse dependency D of a package P is not built yet, then D will be in
"exclusions" as we can't sensibly run D's tests at that time. In that case,
don't just ignore the missing test result but consider D's test as "in
progress".

Note that this might lead to stalling an innocent P if a broken (FTBFS) D gets
uploaded at the same time. This can/should be handled by overrides if fixing
D isn't appropriate, but this is better than allowing P to break D in that
situation.
2015-08-11 08:01:04 +02:00
Martin Pitt
4e5ed1739d merge trunk 2015-08-04 07:36:42 +02:00