mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
test(ci): cover the mesh axis
A fully pinned priority row now pins the mesh state too, and a priority row with more combinations than the distro pool has members wraps the rotation instead of holding one distribution per combination.
This commit is contained in:
1 file changed
+10
-2
@@ -111,6 +111,7 @@ class TestArtifactSlug(unittest.TestCase):
|
||||
entry["tor"] == "true",
|
||||
entry["distro"],
|
||||
entry["filesystem"],
|
||||
entry["vpn"] == "true",
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -222,7 +223,7 @@ class TestPriorityCoverage(unittest.TestCase):
|
||||
def test_an_incapable_priority_variant_skips_its_onion_runs(self) -> None:
|
||||
rows = [_row("web-app-a", 1, ("compose", "swarm"), priority=True)]
|
||||
entries = _assign(rows, sweep=0, tor_mode="auto", variants_per_app=_VARIANTS)
|
||||
self.assertEqual([e["tor"] for e in entries], ["false", "false"])
|
||||
self.assertEqual({e["tor"] for e in entries}, {"false"})
|
||||
|
||||
|
||||
class TestAssign(unittest.TestCase):
|
||||
@@ -371,6 +372,7 @@ class TestPinnedAxes(unittest.TestCase):
|
||||
priority=True,
|
||||
pin_mode="swarm",
|
||||
pin_tor=False,
|
||||
pin_vpn=False,
|
||||
)
|
||||
self.assertEqual(len(self._entries(row)), 1)
|
||||
|
||||
@@ -447,7 +449,13 @@ class TestDistroAndFilesystemAxes(unittest.TestCase):
|
||||
def test_a_priority_row_spreads_its_combinations_over_the_pool(self) -> None:
|
||||
rows = [_row("web-app-b", 0, ("compose", "swarm"), priority=True)]
|
||||
entries = _assign(rows, sweep=0, tor_mode="auto", variants_per_app=_VARIANTS)
|
||||
self.assertEqual(len({e["distro"] for e in entries}), len(entries))
|
||||
self.assertEqual(
|
||||
len({e["distro"] for e in entries}),
|
||||
min(len(entries), len(axes.DISTROS)),
|
||||
"a priority row must walk the pool, not repeat one distribution; "
|
||||
"once it has more combinations than the pool has members, the "
|
||||
"rotation wraps and every distribution is proven at least once",
|
||||
)
|
||||
|
||||
def test_a_pinned_distro_replaces_the_rotation(self) -> None:
|
||||
rows = [_row("web-app-b", 0, ("compose",), pin_distro="fedora")]
|
||||
|
||||
Reference in new issue
Block a user