diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efd0938..5d1e2d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,30 @@ jobs: uv run pytest -q -rs tests/test_okf.py::test_reference_parser_and_viewer | tee "$RUNNER_TEMP/okf.txt" grep -q -E '^1 passed' "$RUNNER_TEMP/okf.txt" + folder-conformance: + # The folder format's conformance fixture lives in Atlas, the reference implementation. + # tests/test_reader.py skips its conformance group unless it is handed a copy, so the gates + # above never run it. Here the fixture is read from Atlas's default branch as it stands and a + # skip is a failure. When Atlas moves the fixture, this job goes red on the version the test + # names, until the reader has been read against what moved. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + - run: uv sync --locked + - name: Atlas's conformance fixture, as its default branch has it + run: | + git clone -q --depth 1 --filter=blob:none --sparse https://github.com/OnlyWorlds/atlas "$RUNNER_TEMP/atlas" + git -C "$RUNNER_TEMP/atlas" sparse-checkout set tests/fixtures/folder-conformance + git -C "$RUNNER_TEMP/atlas" log -1 --format='atlas %h %ad' --date=short + test -f "$RUNNER_TEMP/atlas/tests/fixtures/folder-conformance/expected.json" + - name: The reader's tests with the fixture, where a skip fails + env: + OW_CONFORMANCE_FIXTURE: ${{ runner.temp }}/atlas/tests/fixtures/folder-conformance + run: | + uv run pytest -q -rs tests/test_reader.py | tee "$RUNNER_TEMP/reader.txt" + grep -q -E '^[0-9]+ passed in ' "$RUNNER_TEMP/reader.txt" + wire: # keel's own OpenAPI document and the public demo world, read only, and a few writes to the # practice world (its published key, reset every night), each deleted again. Red here with diff --git a/tests/test_reader.py b/tests/test_reader.py index 2fb6d8e..6b90a92 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -36,7 +36,8 @@ def fingerprint(root: Path) -> dict[str, str]: def test_conformance_fixture(legacy: bool) -> None: assert FIXTURE is not None # needs_fixture skips the test otherwise expected: dict[str, Any] = json.loads((FIXTURE / "expected.json").read_text(encoding="utf-8")) - assert expected["fixture_version"] == "1.2.1" # 1.2.0 to 1.2.1 changed no element + # 1.2.0 to 1.2.1 changed no element; 1.2.2 renamed one, and its file with it (id and body kept) + assert expected["fixture_version"] == "1.2.2" world_dir = FIXTURE / "world" before = fingerprint(FIXTURE) diff --git a/tests/test_staging_writes.py b/tests/test_staging_writes.py index fccc205..315de55 100644 --- a/tests/test_staging_writes.py +++ b/tests/test_staging_writes.py @@ -137,7 +137,7 @@ def test_links_dedupe_tolerate_absent_ids_and_are_scrubbed_on_delete( assert owner.get("character", person["id"])["family"] == [] with pytest.raises(ApiError) as gone: owner.get("family", fid) - assert gone.value.status == 404 + assert (gone.value.status, gone.value.code) == (410, "gone") # a deleted element reads gone, not absent def test_bulk_partial_atomic_cycles_and_replay(owner: Client, made: list[tuple[str, str]]) -> None: