Skip to content

Unit, parity and upgrade tests ​

Work item issue-557, testing-plan activity T1, T6, T10. Run on 2026-11-30 in the work item's checkout.

Every command below was run with THE_LOOP_INSTANCE, THE_LOOP_WORK_ITEM and THE_LOOP_CLI_CONFIG unset. This session runs inside a the-loop daemon, and those variables make about 46 unrelated tests fail on an untouched checkout of main too (poller status, stop-check). They are not set in CI.

The whole suite ​

sh
cd cli && uv run python -m pytest -q
text
8174 passed, 2 skipped, 4 warnings in 297.78s (0:04:57)

Run after the last review fix. make check ran the same suite one fix earlier (see checks.md).

T1: the units this work item added or changed ​

sh
cd cli && uv run python -m pytest -q tests/test_quiz.py tests/test_quiz_banner.py tests/test_quiz_banner_ops.py tests/test_quiz_taken.py tests/test_quiz_taken_keyword.py tests/test_graph_skips.py tests/test_state_portability.py tests/test_selection_layout.py tests/test_selection_control.py
text
385 passed in 2.14s

New test files: test_quiz_banner.py (rows, rendering, placement, fallback, refresh), test_quiz_banner_ops.py (the five GitHub operations), test_quiz_taken.py (the record), test_quiz_taken_keyword.py (the open keyword).

T6: parity and golden fixtures ​

sh
cd cli && uv run python -m pytest -q tests/test_jira_format.py tests/test_writing_parity.py tests/test_docs_parity.py tests/test_init_commands.py tests/test_strings_catalog.py tests/test_eventlog.py tests/test_cli_config.py tests/test_graph_parity.py tests/test_selection_layout.py
text
159 passed in 3.89s

These are the tests that fail when a document, the schema, the string catalog or a golden checklist disagrees with the code. The handoff and Jira goldens were regenerated with the repository's own switches (THE_LOOP_REGEN_HANDOFF_GOLDEN=1, THE_LOOP_REGEN_JIRA_GOLDEN=1).

T10: state written before the change ​

sh
cd cli && uv run python -m pytest -q -k "legacy or renamed or pre_change" -v
text
===================== 45 passed, 8131 deselected in 3.79s ======================

Red, then green ​

The new and changed test files were run against the production code of main (96593502), in a separate checkout, before being run against this branch.

sh
git checkout the-loop/issue-557-quiz-only -- cli/tests   # tests from the branch, code from main
cd cli && uv run python -m pytest -q tests/<file>
text
test_quiz.py: 1 error in 0.55s
test_quiz_integration.py: 1 error in 0.41s
test_quiz_banner.py: 1 error in 0.36s
test_quiz_banner_ops.py: 12 failed in 0.33s
test_quiz_taken.py: 1 error in 0.25s
test_quiz_taken_keyword.py: 1 error in 0.24s
test_quiz_taken_integration.py: 1 error in 0.32s
test_graph_skips.py: 5 failed, 80 passed in 0.87s
test_state_portability.py: 4 failed, 13 passed in 0.41s
test_selection_layout.py: 2 failed, 9 passed in 0.45s
test_pdlc_e2e_integration.py: 6 failed, 11 passed in 0.79s

1 error is a collection error: the file imports a module or a name that does not exist on main. On this branch every one of these files passes (the T1, T2 and T4 runs).

How the order really went. Tasks 1–6 were coded first and their tests written straight after, by a second agent working from the spec. Tasks 9–16 had their tests written with the code, file by file. The table above is the proof that each test fails without the change; it is not a claim that every test was written before its code.

The UI package ​

npm --prefix ui test fails 67 of 382 tests in this environment, and fails the same 67 on an untouched checkout of main: ui/package-lock.json is out of sync with ui/package.json there (npm ci refuses), so the install used npm install --no-package-lock. This work item changes two strings in ui/src/demo/fixture.ts; npm run typecheck passes. Not counted as evidence either way.

Released under the MIT License.