Skip to content

Convert golden_diff.py's CLI invocation into a real pytest test (#329) - #398

Merged
squid-protocol merged 1 commit into
mainfrom
feat/329-golden-crucible-pytest
Jul 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/329-golden-crucible-pytest

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Part 3 of the golden-crucible cleanup (#328 done via #395/#397, #329/#330 remaining).

  • Adds tests/test_golden_crucible.py: runs the real galaxyscope CLI against the language-crucible corpus and diffs against whichever golden master fixture matches the current environment (same zero_dependency_mode detection galaxyscope.py itself uses), using golden_diff.py's comparison functions as a library instead of a subprocess shell-out.
  • New golden_crucible pytest marker, excluded from the default pytest tests/ run via pyproject.toml's addopts -- it needs the corpus checked out locally (LANGUAGE_CRUCIBLE_PATH env var, or a sibling ../language-crucible dir by default) and takes real wall-clock time. Skips cleanly with a clear message if the corpus is missing rather than failing.
  • golden-crucible.yml now runs pytest -m golden_crucible instead of duplicating the "run galaxyscope, diff against golden master" logic directly in the workflow -- one implementation instead of two that could drift apart.

Test plan

  • LANGUAGE_CRUCIBLE_PATH=... pytest -m golden_crucible tests/test_golden_crucible.py -v passes in both a full-precision venv and a zero-dependency venv
  • Default pytest tests/ run deselects this test (866 passed, 1 deselected, 1 pre-existing xfail)
  • Workflow YAML parses cleanly (yaml.safe_load)
  • flake8 . --select=E9,F63,F7,F82 and python tests/dead_key_audit.py --ci clean

Adds tests/test_golden_crucible.py: runs the real `galaxyscope` CLI entry
point against the language-crucible corpus and diffs the result against
whichever golden master fixture matches the current environment (reuses
the same zero_dependency_mode detection galaxyscope.py itself uses), via
golden_diff.py's comparison functions imported as a library rather than
shelled out to.

Opt-in via a new `golden_crucible` pytest marker, excluded from the
default `pytest tests/` run through pyproject.toml's addopts (it needs
the language-crucible corpus checked out locally -- LANGUAGE_CRUCIBLE_PATH
env var, or a sibling `../language-crucible` directory by default -- and
takes real wall-clock time). Skips cleanly with a clear message if the
corpus isn't present, rather than failing.

golden-crucible.yml now runs `pytest -m golden_crucible` instead of
duplicating the "run galaxyscope, diff against golden master" logic
directly in the workflow, so there's one implementation instead of two
that could drift apart.

Verified: both full-precision and zero-dependency modes pass locally
against the fixtures from #395/#397; the CI workflow YAML parses cleanly;
866 passed, 1 deselected (this new test, correctly excluded from the
default run), 1 pre-existing xfail; flake8 and dead_key_audit clean.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 53ad8f8 into main Jul 25, 2026
24 checks passed
@squid-protocol
squid-protocol deleted the feat/329-golden-crucible-pytest branch July 25, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant