859 Commits

Author SHA1 Message Date
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
358920c395 Add missing force-{bad,skip}test data to excuses (for the YAML) 2015-08-25 13:34:41 +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
751989565e Enable armhf in ADT_ARCHES 2015-08-25 10:32:03 +02:00
Martin Pitt
c5f6ad6452 python-apt/precise workaround: Don't prematurely close TagFile fd
Don't close underlying fd right after opening an apt_pkg.TagFile, as that will
prematurely end the iteration. This seems to work with more recent python3-apt,
but not with Ubuntu 12.04 LTS.
2015-08-24 20:46:52 +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
a4488a1502 Add missing AUTOPKGTEST field for fake source 2015-08-18 23:36:24 +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
65b2686232 config: Add public production Swift URL and Ubuntu AMQP server
These are all public information. Just use a stub for the (secret) password.
2015-08-14 09:45:24 +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
Cyril Brulebois
85070f38d8 excuses: New try for block-udeb → d-i RM.
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2015-08-11 22:26:57 +00:00
Cyril Brulebois
753087510b Revert "excuses: Point to the d-i release manager when block-udeb is involved."
This reverts commit 6adee798cd0bec3b64c8a6315667d68ab3c16bd9.

Patching the wrong location considered unhelpful.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2015-08-11 22:25:23 +00:00
Cyril Brulebois
025d0dd3cf excuses: Point to the d-i release manager when block-udeb is involved.
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2015-08-11 21:38:36 +00:00
Martin Pitt
ee0d5096de Fix KeyError from last commit, needs more thorough debugging when that happens 2015-08-11 17:19:02 +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
ee4450b671 Switch autopkgtest evaluation to cloud results
- Change AutoPackageTest.results() to evaluate the Swift results instead of
   the adt-britney ones.
 - Drop TestAdtBritney tests which now fail as we switched results evaluation
   to swift. Port relevant tests to TestAutoPkgTest.
 - Drop obsolete adt-britney autopkgtest code.
 - Adjust TestBoottestEnd2End.test_with_adt() for cloud results.
2015-08-04 07:39:23 +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
a6bbfa6989 show differences in jenkins and cloud based autopkgtests 2015-08-02 12:56:09 +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
89be9112d3 Alphabetically sort cloud autopkgtest results 2015-07-31 09:18:17 +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
bfe182b090 add "run-autopkgtest" tool to re-run tests 2015-07-16 16:47:25 +02:00
Martin Pitt
91418f7eb9 Add hints file for pitti 2015-07-16 15:39:35 +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