Fail the tests that skipped at run time, naming what they miss, and give CI's tests docker

This commit is contained in:
2026-11-18 17:33:04 +01:00
parent fa34d832aa
commit 9cc505b764
11 changed files with 37 additions and 39 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from test_env import isolated_env
from test_env import assert_not_root, isolated_env
from project_config.test_project_config import write_config
BIN = pathlib.Path(__file__).resolve().parents[1]
@@ -753,8 +753,8 @@ class Cycles(unittest.TestCase):
self.assertIn("past the noise", run.stdout)
self.assertIn("past the noise", run.calls[1]["stdin"])
@unittest.skipIf(os.geteuid() == 0, "root reads an unreadable file")
def test_exits_1_when_the_transcript_cannot_be_read(self):
assert_not_root(self)
checkout = Checkout(self)
run = checkout.run([worker(unreadable=True)])
self.assertEqual((run.code, run.roles()), (1, ["worker"]))
@@ -1000,8 +1000,8 @@ class Interrupt(unittest.TestCase):
self.assertFalse(run.calls[2]["ctrl_c_ignored"])
self.assertIn("[human] B", run.calls[3]["stdin"])
@unittest.skipIf(os.geteuid() == 0, "root reads an unreadable file")
def test_exits_1_when_the_transcript_cannot_be_read_after_the_interrupt(self):
assert_not_root(self)
checkout = Checkout(self)
run = checkout.run([worker(say="A or B?"), judge(interrupt=True, evidence="A or B?", question="A or B?"), interrupt(type="B", unreadable=True)], terminal_input="/talk\n", before_typing=ANSWERING)
self.assertEqual((run.code, run.roles()), (1, ["worker", "judge", "interrupt"]))
@@ -1082,8 +1082,8 @@ class Models(unittest.TestCase):
self.assertIn("no model catalog cached", run.stderr)
self.assertEqual(argument(run.calls[0], "--model"), "1")
@unittest.skipIf(os.geteuid() == 0, "root writes into a read-only directory")
def test_exits_1_when_the_models_file_cannot_be_written(self):
assert_not_root(self)
checkout = Checkout(self)
del checkout.env["LOOP_CLAUDE_JUDGE_MODEL"], checkout.env["LOOP_CLAUDE_WORKER_MODEL"]
checkout.models_file().parent.mkdir(parents=True, mode=0o500)
+4 -3
View File
@@ -18,6 +18,7 @@ import uuid
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from test_env import assert_not_root
from routing_figures import archive, state
from claude_code.output_limits import BASH_CEILING_CHARACTERS
from routing_figures.calls import Call
@@ -519,8 +520,8 @@ Spent since 2026-09-21T14:13:20Z, in tokens of input, cache write 5m, cache writ
[next_chunk] = set(self.archive.iterdir()) - {chunk}
self.assertEqual(sorted(path.read_text() for path in (next_chunk / "session" / str(self.session.id)).glob("custom-title.json*")), ["third"])
@unittest.skipIf(os.geteuid() == 0, "root reads an unreadable folder")
def test_stops_on_a_session_folder_it_cannot_read_whole(self):
assert_not_root(self)
locked = self.paths.claude_code_transcripts / "-fake" / str(self.session.id) / "subagents"
locked.mkdir(parents=True)
locked.chmod(0)
@@ -689,8 +690,8 @@ Spent since 2026-09-21T14:13:20Z, in tokens of input, cache write 5m, cache writ
self.assertIn(f"\n{STAMP} Which one?\a\n", said.getvalue())
self.assertNotIn("Use ... A.", said.getvalue())
@unittest.skipIf(os.geteuid() == 0, "root writes into a read-only directory")
def test_stops_keeping_the_transcript_when_the_finished_chunks_session_cannot_be_deleted(self):
assert_not_root(self)
folder = self.paths.claude_code_transcripts / "-fake" / str(self.session.id)
(folder / "subagents").mkdir(parents=True)
folder.chmod(0o500)
@@ -967,8 +968,8 @@ class RoutingCheck(unittest.TestCase):
stop, _ = self.check(FakeEffects(on_terminal_claude=[OSError(2, "No such file or directory")], git=[UNREAD] * 3))
self.assertEqual(stop, Stop(1, f"could not start claude for the routing calls in {self.home / 'code' / 'claude-config'}, the setup's development clone: No such file or directory"))
@unittest.skipIf(os.geteuid() == 0, "root writes into a read-only directory")
def test_says_a_figure_it_cannot_write_and_goes_on(self):
assert_not_root(self)
self.chunks(5, 4)
(self.root / "routing-figures.lock").touch()
self.root.chmod(0o555)