mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
revert(ci): the axis tests cover the swarm-only vpn axis again
This commit is contained in:
1 file changed
+3
-105
@@ -337,85 +337,13 @@ class TestMeshRotation(unittest.TestCase):
|
||||
arms = {e["vpn"] for e in self._entries(sweep) if e["mode"] == "swarm"}
|
||||
self.assertEqual(arms, {"true", "false"})
|
||||
|
||||
def test_every_sweep_lands_smallest_compose_rows_on_both_arms(self) -> None:
|
||||
def test_a_compose_row_never_carries_the_mesh(self) -> None:
|
||||
for sweep in range(8):
|
||||
with self.subTest(sweep=sweep):
|
||||
arms = {
|
||||
e["vpn"] for e in self._entries(sweep) if e["mode"] == "compose"
|
||||
}
|
||||
self.assertEqual(arms, {"true", "false"})
|
||||
|
||||
def test_a_compose_row_of_a_larger_variant_never_carries_the_mesh(self) -> None:
|
||||
rows = [_row("web-app-a", 0, ("compose",)) for _ in range(8)]
|
||||
for vpn_mode in ("auto", "enforced"):
|
||||
for sweep in range(8):
|
||||
with self.subTest(vpn_mode=vpn_mode, sweep=sweep):
|
||||
entries = _assign(
|
||||
rows,
|
||||
sweep=sweep,
|
||||
tor_mode="auto",
|
||||
vpn_mode=vpn_mode,
|
||||
variants_per_app=_VARIANTS,
|
||||
)
|
||||
self.assertEqual({e["vpn"] for e in entries}, {"false"})
|
||||
|
||||
def test_the_smallest_variant_is_the_one_enabling_fewest_services(self) -> None:
|
||||
rows = [_row("web-app-a", 1, ("compose",))]
|
||||
entries = _assign(
|
||||
rows,
|
||||
sweep=0,
|
||||
tor_mode="auto",
|
||||
vpn_mode="enforced",
|
||||
variants_per_app=_VARIANTS,
|
||||
)
|
||||
self.assertEqual({e["vpn"] for e in entries}, {"true"})
|
||||
|
||||
def test_a_held_axis_holds_smallest_compose_rows(self) -> None:
|
||||
for vpn_mode, expected in (("enforced", "true"), ("disabled", "false")):
|
||||
with self.subTest(vpn_mode=vpn_mode):
|
||||
entries = _assign(
|
||||
[_row("web-app-b", 0, ("compose",)) for _ in range(8)],
|
||||
sweep=0,
|
||||
tor_mode="auto",
|
||||
vpn_mode=vpn_mode,
|
||||
variants_per_app=_VARIANTS,
|
||||
)
|
||||
self.assertEqual({e["vpn"] for e in entries}, {expected})
|
||||
|
||||
def test_every_compose_title_states_its_mesh(self) -> None:
|
||||
for row in (
|
||||
_row("web-app-b", 0, ("compose",)),
|
||||
_row("web-app-a", 0, ("compose",)),
|
||||
):
|
||||
for sweep in range(8):
|
||||
with self.subTest(app=row["name"], sweep=sweep):
|
||||
entry = _assign(
|
||||
[row], sweep=sweep, tor_mode="auto", variants_per_app=_VARIANTS
|
||||
)[0]
|
||||
glyph = to_emoji("vpn" if entry["vpn"] == "true" else "direct")
|
||||
self.assertIn(glyph, entry["label"])
|
||||
|
||||
def test_a_larger_compose_variant_reads_direct(self) -> None:
|
||||
label = _assign(
|
||||
[_row("web-app-a", 0, ("compose",))],
|
||||
sweep=0,
|
||||
tor_mode="auto",
|
||||
vpn_mode="enforced",
|
||||
variants_per_app=_VARIANTS,
|
||||
)[0]["label"]
|
||||
self.assertIn(to_emoji("direct"), label)
|
||||
self.assertNotIn(to_emoji("vpn"), label)
|
||||
|
||||
def test_a_host_title_carries_no_mesh_glyph(self) -> None:
|
||||
label = _assign(
|
||||
[_row("web-app-b", 0, ("host",))],
|
||||
sweep=0,
|
||||
tor_mode="auto",
|
||||
vpn_mode="enforced",
|
||||
variants_per_app=_VARIANTS,
|
||||
)[0]["label"]
|
||||
self.assertNotIn(to_emoji("vpn"), label)
|
||||
self.assertNotIn(to_emoji("direct"), label)
|
||||
self.assertEqual(arms, {"false"})
|
||||
|
||||
|
||||
class TestPinnedAxes(unittest.TestCase):
|
||||
@@ -426,35 +354,6 @@ class TestPinnedAxes(unittest.TestCase):
|
||||
row = _row("web-app-b", 0, ("compose", "swarm"), pin_mode="swarm")
|
||||
self.assertEqual([e["mode"] for e in self._entries(row)], ["swarm"])
|
||||
|
||||
def test_a_mesh_pin_no_mode_of_the_row_can_take_aborts(self) -> None:
|
||||
for row in (
|
||||
_row("web-app-a", 0, ("compose",), pin_vpn=True),
|
||||
_row("web-app-b", 0, ("host",), pin_vpn=True),
|
||||
_row(
|
||||
"web-app-a", 0, ("compose", "swarm"), pin_mode="compose", pin_vpn=True
|
||||
),
|
||||
):
|
||||
with (
|
||||
self.subTest(modes=row["modes"], pin_mode=row.get("pin_mode")),
|
||||
self.assertRaises(SystemExit),
|
||||
):
|
||||
self._entries(row)
|
||||
|
||||
def test_a_mesh_pin_keeps_the_rotation_on_a_meshable_mode(self) -> None:
|
||||
row = _row("web-app-a", 0, ("compose", "swarm"), pin_vpn=True)
|
||||
for sweep in range(4):
|
||||
with self.subTest(sweep=sweep):
|
||||
entries = _assign(
|
||||
[row], sweep=sweep, tor_mode="auto", variants_per_app=_VARIANTS
|
||||
)
|
||||
self.assertEqual(
|
||||
{(e["mode"], e["vpn"]) for e in entries}, {("swarm", "true")}
|
||||
)
|
||||
|
||||
def test_a_direct_pin_is_always_possible(self) -> None:
|
||||
row = _row("web-app-a", 0, ("compose",), pin_vpn=False)
|
||||
self.assertEqual({e["vpn"] for e in self._entries(row)}, {"false"})
|
||||
|
||||
def test_a_pinned_onion_state_replaces_the_rotation(self) -> None:
|
||||
row = _row("web-app-b", 0, ("compose",), pin_tor=True)
|
||||
self.assertEqual([e["tor"] for e in self._entries(row)], ["true"])
|
||||
@@ -643,7 +542,7 @@ class TestDistroAndFilesystemAxes(unittest.TestCase):
|
||||
|
||||
def test_the_glyphs_follow_the_onion_slot_in_the_label(self) -> None:
|
||||
entry = _assign(
|
||||
[_row("web-app-a", 0, ("compose",))],
|
||||
[_row("web-app-b", 0, ("compose",))],
|
||||
sweep=0,
|
||||
tor_mode="disabled",
|
||||
distros=("debian",),
|
||||
@@ -654,7 +553,6 @@ class TestDistroAndFilesystemAxes(unittest.TestCase):
|
||||
entry["label"].startswith(
|
||||
to_emoji("compose")
|
||||
+ to_emoji("clearnet")
|
||||
+ to_emoji("direct")
|
||||
+ to_emoji("debian")
|
||||
+ to_emoji("zfs")
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user