aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-21 10:32:55 +0200
committerDanilo M. <danix@danix.xyz>2026-10-21 10:32:55 +0200
commitbe69467c2caefddc1f04d5be71d36f6b8d9c13d3 (patch)
treeb7aa71813e656da82187422181ca3f75501e0d3e /tests
parent88d83139b2cf6fa22df823054936a49d14f4f554 (diff)
downloadsb-builder-be69467c2caefddc1f04d5be71d36f6b8d9c13d3.tar.gz
sb-builder-be69467c2caefddc1f04d5be71d36f6b8d9c13d3.zip
sbb-remote 0.11.0: rebuild-tree job (phase 3)
New job kind rebuild-tree runs slackrepo_setup_SBo-danix.sh, which now builds the fresh tree beside the live one and swaps it in. The Jobs tab gets a Rebuild tree action behind a modal confirm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gui.py13
-rw-r--r--tests/test_remote.py5
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index c89dc86..aa6d681 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -602,6 +602,17 @@ class SmokeTest(unittest.TestCase):
d.run_btn.click()
self.assertIn(("job-start", "sbshadow", "--yes"), remote.calls)
+ def test_rebuild_tree_confirms(self):
+ w, remote = self.window(**{"job-start": ({"id": "20260101-000001-rebuild-tree"}, None)})
+ tab = w.jobs_tab
+ act = next(a for a in tab.actions if a.text() == "Rebuild tree")
+ tab.confirm = lambda q: False
+ act.trigger()
+ self.assertNotIn(("job-start", "rebuild-tree"), remote.calls)
+ tab.confirm = lambda q: True
+ act.trigger()
+ self.assertIn(("job-start", "rebuild-tree"), remote.calls)
+
def test_jobs_tab_badge(self):
w, remote = self.window(jobs=({"jobs": [JOB]}, None))
w.poll_jobs()
@@ -705,7 +716,7 @@ class SmokeTest(unittest.TestCase):
["Select visible", "Clear", "No download", "Refresh"]),
"Results": (["Show build log"], ["Refresh"]),
"Repository": ([], ["Refresh"]),
- "Jobs": (["Pull overlay", "Check shadowing", "Run it", "Kill"], []),
+ "Jobs": (["Pull overlay", "Check shadowing", "Rebuild tree", "Run it", "Kill"], []),
}
for i in range(w.tabs.count()):
w.tabs.setCurrentIndex(i)
diff --git a/tests/test_remote.py b/tests/test_remote.py
index 3ac584a..44d3a90 100644
--- a/tests/test_remote.py
+++ b/tests/test_remote.py
@@ -177,6 +177,11 @@ class KindsTest(Base):
with self.assertRaises(sbb.Error):
sbb.KINDS["publish"](self.cfg, ["x"])
+ def test_rebuild_tree(self):
+ self.assertEqual(sbb.KINDS["rebuild-tree"](self.cfg, []), (["slackrepo_setup_SBo-danix.sh"], {}))
+ with self.assertRaises(sbb.Error):
+ sbb.KINDS["rebuild-tree"](self.cfg, ["--yes"])
+
def test_rejects_bad_args(self):
for kind, args in (("sbpull", ["evil", "--no"]), ("sbpull", ["personal"]),
("sbpull", ["personal", "--force"]), ("sbshadow", []),