520 Commits

Author SHA1 Message Date
Aleksa Svitlica
9246a3d583 fix(cloud): Replace PurePath with os.path.join
In Python 3.5 open does not work correctly with PurePath. Switching to
os.path.join to resolve this.
2023-02-15 12:41:14 -05:00
Aleksa Svitlica
bea7377396 feat(cloud): Handle cloud testing errors
Cloud test framework can run into errors (like SSH connection drops)
which cause it to error out and not report test results. To handle these
kinds of errors the policy now checks the return code and stores
std_err.

Also updates the test already run check to not count states of zero
failures and non-zero errors; since this means the test framework
encountered an error external to the tests.
2023-02-14 22:44:24 -05:00
Łukasz 'sil2100' Zemczak
85c6716af6 Set the verdict correctly too. 2023-02-14 14:49:46 +01:00
Łukasz 'sil2100' Zemczak
340b41afe1 Save state file in-between runs to mark which packages have already been tested on the given clouds. 2023-02-14 14:22:43 +01:00
Łukasz 'sil2100' Zemczak
dde56aa490 Actually, don't override the options-passed ADT_PPAs if no need. 2023-02-13 16:08:35 +01:00
Łukasz 'sil2100' Zemczak
b2b1da42fa The autopkgtest policy basically turns adt_ppas into a list, so let's handle the case where the autopkgtest policy runs first. 2023-02-13 14:40:38 +01:00
Łukasz 'sil2100' Zemczak
be55223a67 Merge branch 'feat/add-cloud-policy' of git+ssh://git.launchpad.net/~aleksa-svitlica/cloudware/+git/britney2-ubuntu into sil2100/private-runs 2023-02-13 11:13:40 +01:00
Łukasz 'sil2100' Zemczak
1848597433 Support PPAs which have fingerprint enabled in them. 2023-02-13 11:03:59 +01:00
Aleksa Svitlica
f21d94d3b2 CloudPolicy: Support public PPAs with fingerprints
Updates the _parse_ppas function to also allow public PPAs with
fingerprints to be provided (team/name:fingerprint).
2023-02-10 13:21:01 -05:00
Aleksa Svitlica
2bd1584c84 CloudPolicy: Refactor to use adt_ppas
Cloud policy now uses the ADT_PPAS field as the source but will only
take private PPAS due to requiring a fingerprint. If ADT_PPAS is empty
then the 'proposed' archive is used.

Adds logic to try and retrieve the install source of a package from the
logs. This is useful if multiple PPAs are defined since the policy won't
explicitly know when contains the package under test.
2023-02-01 21:23:59 -05:00
Aleksa Svitlica
1c6f56ab79 Cloud Policy: Remove xunitparser dependency
To avoid an external dependency the required xunit parsing has been
implemented directly in the policy.
2023-01-23 20:17:01 -05:00
Aleksa Svitlica
c6e4e18a23 CloudPolicy: Move hardcoded values to config
Changes made
- Multiple hardcoded fields moved to config
- Series is now retrieved from options
- Pocket is now called source and retrieved from config
- Adds source type config which can be either archive or ppa
- Returns REJECTED_PERMANENTLY policy verdict when test failures or
  errors occur. Adds verdict info the the excuse.
2023-01-23 17:02:12 -05:00
Aleksa Svitlica
436626145b Add Cloud Policy
The cloud policy is currently used to test whether the proposed
migration will break networking for an image in the Azure cloud. Cloud
testing will likely increase in scope in the future.
2023-01-08 10:48:53 -05:00
Steve Langasek
de19e280b2 More optimizations to not query unused baseline results 2022-08-23 15:05:50 -07:00
Steve Langasek
479662c63e Don't query for baseline results we won't use.
britney currently spends a majority of its runtime querying for baseline
test results that it won't find, and that it doesn't need.  Refactor to
eliminate many of these excess queries.
2022-08-23 14:03:41 -07:00
Brian Murray
0998eeaa1a We moved away from freenode a while ago 2022-06-29 10:52:13 -07:00
Łukasz 'sil2100' Zemczak
1c32e3014b Re-add Bileto 4810 to the temporary exclude list. 2022-03-30 10:42:26 +02:00
Łukasz 'sil2100' Zemczak
d51e0be23a Fix typo in bileto ppa name. 2022-03-28 18:46:07 +02:00
Julian Andres Klode
f078aa28d0 do not group the ppc64el rebuilds by their bileto ppa 2022-03-28 10:54:21 +02:00
Haw Loeung
fd20237673
Update email address used for emails
@canonical.com is now DKIM signed and SPF published which means emails
from proposed-migration running on snakefruit sending direct would
likely be caught out. Since we're here, the project is Ubuntu related
so switch to using an @ubuntu.com address instead.
2022-03-22 10:58:40 +11:00
Michael Hudson-Doyle
53aaf8f8e9 allow retrying on "Reference test in progress, but real test failed already" 2022-02-11 09:21:28 +13:00
Steve Langasek
d9d6261b0c Merge remote-tracking branch 'juliank/no-testing-triggers' 2021-11-19 08:34:59 -08:00
Steve Langasek
36459dcdb7 Fix fencepost error when fetching autopkgtest results from sqlite
When querying swift there is no way to take results only newer than a
specified point, you can only query newer than or equal to.  But for sqlite
we can absolutely use > instead of >= and avoid re-processing results we've
already seen.
2021-11-06 22:09:02 -07:00
Steve Langasek
bbdd8105b2 Split all triggers, not just the first one 2021-11-06 19:19:10 -07:00
Steve Langasek
e7eae446b6 Merge remote-tracking branch 'juliank/check-new-migration-reference' 2021-11-05 17:47:32 -07:00
Julian Andres Klode
11a023d133 Only log force-reset-test hints for matching packages
Logging all force-reset-test hints for every package causes
about 850 MB of logs in the last run of 880 MB of logs in total,
let's only log ones matching the package instead, as we do for
force-badtest.
2021-11-06 00:08:28 +01:00
Julian Andres Klode
e9576d55e2 Check for new baseline results if we don't have any yet
In Ubuntu, we only fetch results on demand, so we might not
have seen the results yet.

Debian always fetches results at the beginning so has all the
data ready.
2021-11-05 23:18:15 +01:00
Julian Andres Klode
b60734f118 Do not add autopkgtest triggers that are already in testing
If the version of the trigger in testing is the same, skip it.
2021-11-05 21:44:09 +01:00
Steve Langasek
d87dbf0db2 Merge branch 'adt-results-from-swift' 2021-10-22 16:16:06 -07:00
Steve Langasek
383887a8e3 bdmurray-linting 2021-10-22 16:12:26 -07:00
Steve Langasek
6cd47f352b In the autopkgtest policy, cache the list of force-reset-test hints once
Due to the number of hints in standing use in Ubuntu, hints.search() is an
expensive operation, and we call it once for *every single test* referenced
from -proposed.  Since force-reset-test are a small proportion of the hints
in use, searching once for all the hints of this type and only searching
this subset for each autopkgtest improves performance (with 23000
autopkgtests referenced in -proposed, this saves roughly 1 minute of
runtime, or 11% on a 9-minute britney run; the number of packages in
-proposed is typically much higher at other points in the release cycle,
therefore the absolute improvement in performance is expected to be
greater.)

The force-reset-test hints are an Ubuntu delta so this is not expected to be
upstreamed; and it could eventually be dropped if and when baseline
retesting is implemented in Ubuntu and the number of hints required drops.

This could be implemented with a more generic, elegant solution in
HintsCollection, but again, the scalability problem of hints is hopefully
short-lived so I didn't consider it worth the investment here.
2021-10-07 00:14:49 -07:00
Steve Langasek
794b14b316 Implement support for pulling autopkgtest results from sqlite db 2021-10-07 00:41:56 +00:00
Steve Langasek
af8890bc4b Preliminary code to make autopkgtest policy download autopkgtest.db
Include test to assert britney failure if the database is unavailable
2021-10-07 00:41:56 +00:00
Steve Langasek
3814d63666 Make download_retry work with non-HTTP urls
urlopen() supports non-http URLs, but when called on them, http-related
features are absent - such as getcode().  Make the code work with file:///
URLs.
2021-10-07 00:41:56 +00:00
Steve Langasek
82fad57aa9 Don't use expensive 'remove' hints
Since we've never used remove hints in Ubuntu and never will, we shouldn't
pay the cost for them in britney runs.  Remove references to them entirely,
to speed up britney runs.

This is an Ubuntu delta not expected to be upstreamed, and can be dropped at
some future point when we don't have 11,000 active hints.  (This count of
hints is expected to drop dramatically once we have autopkgtest baseline
retesting.)
2021-10-06 12:54:11 -07:00
Steve Langasek
1f520269de Iterate over binary packages from a source package before iterating over hints
The existing code attempts to "short circuit" processing of binaries in
unstable by first checking if the package is subject to a removal hint.

This is invalid in Ubuntu for two reasons:
- we do not use removal hints for removing packages from the release pocket
- there are 11,000 hints in Ubuntu (due to force-reset-test) - searching all
  hints is time-consuming and not a short-circuit at all.

Reorder the code so we only scan the hints if there's otherwise an
indication of something to do.
2021-10-05 13:21:44 -07:00
Łukasz 'sil2100' Zemczak
738cac82cf Add additional support for additional private test retry capabilities. 2021-07-29 12:56:28 +02:00
Łukasz 'sil2100' Zemczak
090ccdff9e Add an option to configure whether all ADT test results should be displayed or not. 2021-07-19 13:03:14 +02:00
Łukasz 'sil2100' Zemczak
41b606c2ca Commit fixes from staging testing: add required region name parameter. 2021-07-19 12:49:29 +02:00
Łukasz 'sil2100' Zemczak
f79ec3bf54 Revert "Switch from swiftclient for private PPAs to using HTTP with X-Auth-Token instead."
This reverts commit 7ff150ced70d0db565378683909e22dfac5383e1.

Sadly we can't use the X-Auth-Token approach due to implementational details (the token is valid only for an hour). So we need to switch back to using swiftclient.
2021-06-16 09:57:15 +02:00
Łukasz 'sil2100' Zemczak
7ff150ced7 Switch from swiftclient for private PPAs to using HTTP with X-Auth-Token instead.
This way there's less secrets that need to be shared and less new code to introduce. We also modified the test tooling to be able to check for authentication tokens in the queries.
2021-06-09 17:13:56 +02:00
Iain Lane
32c3f288b0 autopkgtest: Check for kernel-triggered tests when migrating kernels
We currently skip the ALWAYSFAIL/REGRESSION handling for kernels. This
can lead to us missing genuine regressions in kernel uploads. The
idea is that results from one kernel flavour shouldn't influence
another.

We can keep this idea but do better and actually check for regressions:
when looking at results, if we're considering a kernel, only look at
results which were triggered by this kernel.
2021-05-21 16:13:13 +01:00
Łukasz 'sil2100' Zemczak
d1549b9ca9 Commit the work regarding private-results handling. 2021-05-06 15:20:00 +02:00
Łukasz 'sil2100' Zemczak
1de71dbbfd Add ability to share results with selected people. 2021-04-28 11:25:35 +02:00
Łukasz 'sil2100' Zemczak
3b1699db2a Fix some comments. 2021-03-30 17:42:42 +02:00
Łukasz 'sil2100' Zemczak
e2932055a9 Add a mock swiftclient for testing, add unit tests for private PPAs and private non-PPA runs, fix some issues discovered through the testing. 2021-03-16 16:38:26 +01:00
Łukasz 'sil2100' Zemczak
2de94184b3 Add support for specifying the GPG fingerprint for private PPAs. 2021-03-15 17:27:17 +01:00
Łukasz 'sil2100' Zemczak
4472b83de9 Require swift creds for private PPAs 2021-03-03 15:20:45 +01:00
Łukasz 'sil2100' Zemczak
18eb7abb01 Initial handling of private PPAs. 2021-03-03 15:00:57 +01:00
Łukasz 'sil2100' Zemczak
7b20866238 Initial attempt on fetching private results from swift. 2021-03-03 14:32:08 +01:00