Ivo De Decker
1a33ee9ebc
installability/tester.py codestyle fixes
5 years ago
Niels Thykier
0d5ea5eb8c
Improve cache invalidation of (pseudo-)essential set
...
If a new pseudo-essential package was added to testing *and* it is
mutually-exclusive with an existing member, britney would incorrectly
flag it as uninstallable (unless another change triggered a cache
invalidation of the pseudo-essential set).
With this commit, the cache invalidation is now done based on whether
we add something that *might* be in the (effective) pseudo-essential
set. It is an overapproximation as there are cases where the
invalidation is unnecessary, but at the moment it is not a performance
concern.
Closes: https://bugs.debian.org/944190
Signed-off-by: Niels Thykier <niels@thykier.net>
5 years ago
Niels Thykier
fce1fe5c27
autopkgtests: Move some common code into a function
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
69d42ffb36
solver: improve apply_order to simplify more code
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
b306700376
solver: Extract a function from _comute_group_order_adds
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
259fecf6cf
solver: Rename a variable to avoid confusion
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
cdcfe85bfa
solver: Replace dict with a proper object
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
93f101bee2
solver: Extract some common code into a function
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
2ed6161b49
solver: Refactor out a function to avoid duplicated code
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
af20634b12
solver: Merge some loops to reduce nesting level
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
b61e1086bd
solver: Invert an if-statement to reduce max indentation level
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
68407c53c0
Remove an unnecessary if-statement
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
9971714e27
solver: Merge two loops by using chain
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
16dc303190
solver: Reduce two small loops into a comprehension
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
d3e06fc45f
solver: Split _compute_group_order into three methods
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c65b377c5d
solver: Split solve_groups into 3 smaller methods
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
7124313aa6
Make InstallabilityTester suite agnostic
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ced7b7b413
Refactor britney.py to use InstallabilityTester less
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0b4f58315f
Rename a method and reduce a table to a set
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0eb8b5a201
BinaryPackageUniverse: Provde equivalent_packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ef813bf0d8
Let the BinaryPackageUnvierse track broken packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
8867ef0cf9
Let the BinaryPackageUniverse track essential packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
07a407e810
Partly separate the solver from the inst_tester
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c0ecdd82fb
Remove now redundant APIs from the InstallabilityTester
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
35b06ee007
tests: Separate inst_tester from universe
...
This commit updates the test suite to use the BinaryPackageUniverse
instead of the InstallabilityTester where that makes sense. The rest
of Britney has yet to be updated except where absolutely necessary (as
that will come in a later commit).
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
d557610c6f
BinaryPackageUniverse: Implement packages_equivalent_to()
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
530db5d3f7
Extract a BinaryPackageUniverse from the InstallabilityTester
...
The InstallabilityTester is suffering from a lack of clear purpose
because it serves multiple. This commit extracts most of one of these
purposes into the BinaryPackageUniverse class while retaining the
original API of the InstallabilityTester.
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
32def47991
Fix typo in doc string
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
f86cda97da
inst_tester: Improve doc string/argument name
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6c5300d873
Unfold the suite.binaries tuple into two members
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c4931fb1b2
solver: Move a common variable out of an if
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
1e46965924
inst/builder.py: Split function in three to reduce indentation levels
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
dd5211d55a
inst-tester: Add missing element to a set
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
55dd190fa6
inst-tester: Make "check" a list
...
Should be slightly cheaper (O(1)) than using a set.
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
cd1f384012
inst-tester: Remove obsolete "safe-set" optimization
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
95b945d2b3
inst-tester: Remove obsolete optimization
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Paul Gevers
713b98ad6b
inst_tester: add is_pkg_in_testing
6 years ago
Niels Thykier
b6888c2716
test-builder: Avoid allocating empty throw-away lists on empty relations
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
373f7f51f3
inst-builder: Avoid some hash-look ups by doing them early
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
35add7cb26
Move loop-invariant out of loop
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
02001d4d4f
inst-builder: Loop over values instead of keys + hash-lookup
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0446ead9e8
inst-builder: Replace RelationBuilder with a set_relations method
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ab6b2ef953
inst-builder: Refactor to bulk adding dependency clauses
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
bc1d3afa38
inst-builder: Make add_breaks a bulk call
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6f97e36477
inst-builder: Split relation loop and optimize conflicts
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6a3d100b92
Fix error format string error in AssertionError
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
fc834624fc
Avoid some unnecessary hash look ups
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
64d2bc4203
builder.py: Make the code suite agnostic
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
41978869ce
Migrate solver's ad-hoc debug logging
...
Signed-off-by: Niels Thykier <niels@thykier.net>
7 years ago
Niels Thykier
69473eefca
solver: Extract compute_scc into a function
...
Signed-off-by: Niels Thykier <niels@thykier.net>
8 years ago