143 Commits

Author SHA1 Message Date
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
Martin Pitt
027404b6e7 Run autopkgtests for DKMS packages
They are being tested through autodep8.
2015-08-03 18:16:18 +02:00
Martin Pitt
e32af66634 autopkgtest: Wait for Swift results for correct triggering package
Swift results were considered for older versions of triggers instead of waiting
for results for the actual package/version that triggered a new test.

This broke due to two reasons:

 * When evaluating the test results we need to check whether we have a result
   for the tested package/version that got triggered by the current excuse, not
   just for any older excuse.

 * AutoPackageTest.fetch_swift_results() re-downloaded all results for a
   package due to a wrong "marker" value: The marker needs to be the
   complete object path, not just the timestamp suffix. This caused old test
   results to be considered as "newer than the given marker".
2015-07-31 12:42:07 +02:00
Martin Pitt
6b46400973 mock_swift.py: Fix handling of marker
Real swift instances evaluate "marker" after "delimiter", and marker returns
results greater (not equal) than the given value.
2015-07-31 11:24:10 +02:00
Martin Pitt
1d4eab951e Add autopkgtest tests for hints 2015-07-31 09:50:38 +02:00
Martin Pitt
48905892c8 Drop obsolete adt-britney autopkgtest code
Now that we look at autopkgtest results from swift we can drop the
adt-britney/lp:auto-package-testing code from autopkgtest.py.
Note that we still need it for boottest.py.

Adjust TestBoottestEnd2End.test_with_adt() for cloud results.
2015-07-31 09:49:01 +02:00
Martin Pitt
4414870683 Add more autopkgtest tests, drop TestAdtBritney
Drop TestAdtBritney tests which now fail as we switched results evaluation to
swift. Port relevant tests to TestAutoPkgTest.
2015-07-31 09:45:19 +02:00
Martin Pitt
31e647f113 Switch autopkgtest evaluation to cloud results
Change AutoPackageTest.results() to evaluate the Swift results instead of the
adt-britney ones.

TODO:
 - Add more tests (like for adt-britney)
 - Drop triggering of adt-britney tests
 - Drop adt-britney tests (which fail now)
 - Adjust TestBoottestEnd2End.test_with_adt
2015-07-31 09:41:51 +02:00
Martin Pitt
0c64998e41 Strip off Multi-Arch qualifiers in reverse dependency calculation
See also http://bugs.debian.org/794194
2015-07-31 09:19:51 +02:00
Martin Pitt
69bf766a7a test_boottest.py: PEP-8 fixes 2015-07-31 06:41:25 +02:00
Martin Pitt
52ae2eca09 Show regression vs. always-failed in cloud results 2015-07-30 14:08:46 +02:00
Martin Pitt
269b156def Drop obsolete adt-britney autopkgtest code
Now that we look at autopkgtest results from swift we can drop the
adt-britney/lp:auto-package-testing code from autopkgtest.py.

Note that we still need it for boottest.py.
2015-07-28 11:46:17 +02:00
Martin Pitt
fc141215e9 Add more autopkgtest tests, drop TestAdtBritney
Drop TestAdtBritney tests which now fail as we switched results evaluation to
swift. Port relevant tests to TestAutoPkgTest.
2015-07-28 11:32:03 +02:00
Martin Pitt
2bf6eb5652 Switch autopkgtest evaluation to cloud results
Change AutoPackageTest.results() to evaluate the Swift results instead of the
adt-britney ones.

TODO:
 - Add more tests (like for adt-britney)
 - Drop triggering of adt-britney tests
 - Drop adt-britney tests (which fail now)
2015-07-28 11:04:34 +02:00
Martin Pitt
76287b50ca Track "ever passed" in results cache
Add bool whether there is any successful test of src/arch of any version. This
will be used for detecting "regression" vs. "always failed".

WARNING: This changes the results.cache format, so results.cache has to be
removed and recreated before deploying this.
2015-07-28 10:46:30 +02:00
Martin Pitt
9b0d09cfd8 Add test case for removed package from unstable
This used to trigger an eternal test loop, but this got fixed with the recent
commits.
2015-07-15 11:25:57 +02:00
Martin Pitt
7a3a6d7309 test_autopkgtest.py: Simplify showing britney output
Show britney output if $SHOW_OUTPUT is set in the environment. This avoids
having to modify the source and reverting it before committing.
2015-07-15 09:49:26 +02:00
Martin Pitt
967dc07c21 Consider manually re-ran failed tests for reverse dependencies
Commit 446 only considered a package's own tests. But we also need to check for
newer results of failed reverse dependency tests.  Introduce a new
failed_tests_for_trigger() helper which computes the failed (src, arch) failed
tests for a given package, and fetch new results for all of them.
2015-07-15 09:49:06 +02:00
Martin Pitt
a7c1fca7ef Robustify test configuration changes
Stop assuming whether an option is commented or not in the default britney.conf
file for the tests.
2015-07-15 08:26:19 +02:00
Martin Pitt
3e7c808e1c Consider manually re-ran failed tests
When collecting results, not only check pending tests, but also new results for
failed tests. This picks up new test results from manual retries which might
now have succeeded.
2015-07-15 08:22:37 +02:00
Martin Pitt
3ce7dc3d84 Add test case for previous commit 2015-07-14 20:19:01 +02:00
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
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
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
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
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
Celso Providelo
ea6493ae71 Only enable BOOTTEST for testing, so britney.conf is safe on trunk. 2015-02-20 14:28:47 -02:00
Celso Providelo
c76874fda5 Test ADT & BootTest criteria running simultaneously. Fixed minor issue related to doubling-blocking promotions. 2015-02-20 14:12:51 -02:00
Celso Providelo
341ec4a3e0 Typo fixed 2015-02-11 10:41:43 -05:00
Celso Providelo
bf8056a061 Cope with missing/broken results due to outdated apt cache. Britney will not fail, but source promotion will be blocked. 2015-02-11 09:45:20 -05:00
Celso Providelo
496a2f3134 Suppress boottest SKIPPED notice on excuses, it's unnecessary noise. 2015-02-10 15:56:35 -05:00
Celso Providelo
b9890e1b7c Adding links to the boottest jobs (results) in the public and the private servers. 2015-02-10 14:51:44 -05:00
Celso Providelo
011aa3570e Stop announcing skipped boottest attempts. 2015-02-10 13:49:43 -05:00
Celso Providelo
a80a1e4f1c Boottest integration adjustments. 2015-02-06 11:43:38 -05:00
Celso Providelo
c3c9005d5f Restore boottest status lookup by source name & version. 2015-02-06 10:38:36 -05:00
Joe Talbott
6269f50abc Don't bother creating another mocked urllib.urlopen. 2015-02-05 17:27:39 -05:00
Celso Providelo
760d08c459 Fix BootTest.get_status to return status for the latest known version. Boottests results are reported for the current (published) version, not the proposed one. 2015-02-05 16:42:29 -05:00
Joe Talbott
f0a55936f5 boottest - Add exception message to warning print and fix typo 2015-02-05 11:20:28 -05:00
Joe Talbott
87ccbfd731 boottest - Add exception handling for manifest fetching 2015-02-05 11:08:53 -05:00