109 Commits

Author SHA1 Message Date
Ivo De Decker
7e05c0e5ac Apply policy to srcarch excuses
Currently no policy implements this.

A policy can now implement apply_src_policy_impl or apply_srcarch_policy_impl
(or both), so apply_src_policy_impl is no longer an abstractmethod.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-01 18:33:02 +00:00
Ivo De Decker
d0b5cc2ce1 Rename apply_policy to apply_src_policy
apply_src_policy expects an excuse with a new source and binaries. It doesn't
apply to srcarch excuses, which only have new binaries for an existing source.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-01 18:28:27 +00:00
Ivo De Decker
0d80bad65c Move handling of policies to PolicyEngine
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-31 19:15:29 +00:00
Niels Thykier
b16ae8046a
Add some '# pragma: no cover' for error cases, abstract methods, etc.
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 18:07:29 +00:00
Niels Thykier
6174d2c3f9
Create a MigrationItemFactory and migrate most code to use it
This is a step towards making migration unit-testable.  This step
reduces the need for global state (in the MigrationItem class as class
fields) and with another step we can remove the global state entirely
and enable unit tests to create migration items without having to
worry about other unit tests.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:00:50 +00:00
Ivo De Decker
18d951be25 Handle dependencies between excuses in a generic way
All types of dependencies between excuses (Depends, Build-Depends,
Build-Depends-Indep, ...) are handled by the same code. The DependencyType is
used to distinguish between the types where needed.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-31 11:46:10 +00:00
Niels Thykier
dd3dcf818f
Mark a regex pattern as a raw string
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-29 04:46:55 +00:00
Ivo De Decker
348274947e Add option fake_runtime to override runtime in britney.conf
This is useful to run tests with the data files from a specific point in time,
without changes due to ageing when the test runs later.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-25 22:12:33 +00:00
Niels Thykier
65b67e763c
Replace the use of inst_tester with new suite functionality
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:20 +00:00
Niels Thykier
0a669461ca
Separate inst_tester from universe
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:12 +00:00
Niels Thykier
6c5300d873
Unfold the suite.binaries tuple into two members
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-25 18:34:41 +00:00
Niels Thykier
99a35a2986
autopkgtest.py: Update previous commit to match recent changes
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-01 19:46:43 +00:00
Iain Lane
c09a229dc9
autopkgtest: Run gcc-n's testuite, if it has one 2018-10-01 19:22:29 +00:00
Paul Gevers
18633e275c
autopkgtest: figure out which packages from unstable are needed
Currently autopkgtest tries to install our trigger from unstable and the rest
from testing. If that fails, than autopkgtest has a fall-back to allow all
packages from unstable to be installed. This has two severe issues:

1) the version of the test and the package it came from may be out-of-sync

2) too much from unstable may be installed, even stuff that should not/is not
allowed to migrate as it breaks stuff.

Make sure that test depends also get added to triggers if they are broken.
E.g. imagine the following scenario: trigger X changes (breaks) the output
generated by Y. Package Z has Y in the test dependencies and compares the
output in the autopkgtest. We want to have the opportunity that a new version
is automatically fixing the situation.

Two use cases are currently unsupported: needs-build (autopkgtest restriction)
and test dependencies generated by autodep8.
2018-09-05 21:37:23 +02:00
Paul Gevers
20a64cadef
Process space separated triggers individually 2018-08-30 16:11:24 +02:00
Niels Thykier
fc834624fc Avoid some unnecessary hash look ups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-12 08:37:07 +00:00
Niels Thykier
1d45b2a3b2 Move autopkgtest specific field to Autopkgtest policy
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-07 19:28:25 +00:00
Paul Gevers
0868962ee3
autopkgtest: Ignore triggers without a forward slash
They are manual triggers in the name of britney, most likely by mistake (but
those happen).

Closes: #905600
2018-08-07 08:47:25 +02:00
Niels Thykier
f67fc00292 AgePolicy: Move self.options usage to constructor/initialization
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 07:22:04 +00:00
Niels Thykier
8e9e099a67 BasePolicy: Make an easy accessor for state_dir
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 07:03:44 +00:00
Niels Thykier
b0e193d955 Add missing @property - otherwise "verdict.is_blocked" is always True
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-05 06:56:53 +00:00
Niels Thykier
36608194f8 test_policy: Add additional tests of AgePolicy
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-04 20:09:03 +00:00
Niels Thykier
e88f4d2e5e AgePolicy: Explicitly ignore comment lines in data files
Currently not useful, but it enables us to write comment lines in the
test data files.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-04 20:09:03 +00:00
Paul Gevers
c219c42804 Add text to excuses in case autopkgtest is delayed
In case autopkgtest triggering is delayed because the required builds aren't
ready yet or the package is not installable, currently there is only the
message that autopktest delays the migration, but no hint why. This commit adds
these hints.
2018-08-01 09:58:41 +00:00
Paul Gevers
08a6cdde6f Don't have britney create migration-references itself
The initial idea was to do this to bootstrap the baseline, but it turns out
that this has the drawback it triggers runs for a package that has a new
autopkgtest where it didn't have it in the version in the target suite. It was
considered harmless (as it would just have a failing reference), but due to
autodep8, package can have a passing result in the target suite while the new
autopkgtest is actually broken. Such a package should not be blocked / getting
a penalty.

The alternative is to make the check here smarter, but as this is only for
bootstrapping, lets do that outside of britney proper.
2018-07-29 14:03:41 +00:00
Niels Thykier
97d707e5c0 britney: Avoid some references to britney.{sources,binaries}
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-29 09:27:20 +00:00
Niels Thykier
6c6b8fcb96 policies: Make policies suite name agnostic
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-29 09:23:12 +00:00
Niels Thykier
54e5eb0e74 policies: Use suite class instead of suite name
When determining whether a policy applies to a given item, use the
suite class rather than the suite name.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-29 09:23:12 +00:00
Niels Thykier
37f02d611c Revert "Rename autopkgtest related hints"
This reverts commit a07fa9f9070fc9c328021db5cc3e4c4f3063798e.

The new names are just as unhelpful and confusing as the old ones.
Undo for now.
2018-07-25 18:17:36 +00:00
Niels Thykier
a07fa9f907 Rename autopkgtest related hints
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-07-25 16:51:03 +00:00
Paul Gevers
bfa5c9f191
Don't show excuses for packages that are PASS, NEUTRAL, RUNNING-ALWAYSFAIL or ALWAYSFAIL 2018-07-25 18:06:29 +02:00
Paul Gevers
0da1e4d589
autopkgtest: Drop broken reference update
1) the update didn't happen for all but the first

2) we don't want a package that fixes a regression in unstable to influence the
   reference for another package until it actually migrates, so this updating
   is flawed.
2018-07-21 13:21:39 +02:00
Paul Gevers
624b185ba6
autopkgtest: enable NEUTRAL state for the case where all tests were skipped (or none available)
Closes: #901847
2018-07-21 13:21:39 +02:00
Paul Gevers
8bbe112735
Rephrase 'Always failed' as it is confusing in Debian 2018-07-21 10:28:17 +02:00
Niels Thykier
e51a3b91ff autopkgtest.py: Avoid unnecessary indirection
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-05-06 06:51:47 +00:00
Niels Thykier
d3638cc08f Make adt_baseline config optional
Given that only one value is defined ("reference"), it is a better
option to allow the config to be unset when one does not want to have
adt_baseline set to "reference".

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-29 07:19:02 +00:00
Paul Gevers
a4d0c4a854
Don't start the tests before arch:all has been build (if applicable) 2018-04-25 21:50:46 +02:00
Paul Gevers
022d6ed564
Packages need passing tests on all tested architectures to receive the bounty 2018-04-16 21:37:30 +02:00
Paul Gevers
7e8ec20bc1
Put autopkgtest state files in their own namespace 2018-04-16 20:52:24 +02:00
Paul Gevers
575993d77b
Drop some linux-meta hardcoded stuff; not in Debian and bug 779559 is fixed long time 2018-04-16 20:52:24 +02:00
Niels Thykier
d7045af2b7 Leverage defaultdict to simplify some code
Notable omissions are "pending_tests" and "tests_results".  This is
omission is due to these (some times) being initialized from the
output of "json.load" (so we cannot assume defaultdict semantics
without manually imported the data into one).

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:25:06 +00:00
Niels Thykier
641df09570 Fix typo in a comment
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:14:24 +00:00
Niels Thykier
686721e91f Rewrite some set constructs
The first case is to avoid a creating a list, which is then converted
to a set only to throw away the list again.  Here we can just create
the set right away without a list inbetween.

The second case is "if x in [...]:" is better written as "if x in
{...}:" as sets provides faster "__contains__" (assuming you are on a
"recent enough python3", which britney is).

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:11:54 +00:00
Niels Thykier
77ec8a34f9 Optimize some hash lookups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:11:32 +00:00
Niels Thykier
499f7d993c Move loop-invariant out of loop
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:11:02 +00:00
Niels Thykier
74fe0c8b8e Use finally to close handles from urlopen
Arguable, this is not a problem in the code as the failure case
invokes sys.exit.  However, this is more future proof as the sys.exit
may be replaced (or we may later catch another exception that is
"recoverable").

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:08:36 +00:00
Niels Thykier
2c34b70492 Remove unused import
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-04-15 10:07:52 +00:00
Paul Gevers
def9d81c76
Make retry URL configurable (two flavors) 2018-04-11 11:17:00 +02:00
Paul Gevers
9a28ec184b
Revert "autopkgtest: Drop retry_url from the excuses as this works different in Debian"
This reverts commit 054830d03f0a04c0306e5e71752646c2f2de2626.
2018-04-11 11:17:00 +02:00
Paul Gevers
cb716e3186
Don't excuse.force() on skiptest hint 2018-04-11 11:16:59 +02:00