Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_staging_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading