Skip to content

fix(tests): keep the L2 golden tool test and the promotion validation off the exported catalog DSN - #537

Open
NeoNix-Lab wants to merge 1 commit into
implement/fidfrom
agent/issue-536-hermetic-l2-golden-tool-test
Open

NeoNix-Lab wants to merge 1 commit into
implement/fidfrom
agent/issue-536-hermetic-l2-golden-tool-test

Conversation

@NeoNix-Lab

Copy link
Copy Markdown
Owner

Summary

  • Closes [bug] tests: the L2 golden tool test publishes into the CATALOG_DSN catalog when the variable is exported #536.
  • tests/test_l2_golden_v1.py: run_tool removes CATALOG_DSN from the environment around the tool (restored afterwards); every test in the file now trips if _catalog_leg is reached. Regression tests: an exported CATALOG_DSN is never forwarded to run_l2_golden, the real success path with it exported never reaches the catalog leg, and the tool itself still defaults --dsn to CATALOG_DSN.
  • infra/promote-main.sh: the candidate suite runs under env -u for every exported PG* and *DSN* variable (names logged as validation_env_unset:, never values); the rest of the environment is unchanged. tests/test_promote_main_v1.py covers it, including that no secret value reaches the log.

Audit (item 2)

Unit tests (tests/test_*.py, the ones tools/run_tests.py runs) that run a tool with an environment-derived DSN:

  • test_l2_golden_v1 — the only leak; fixed here.
  • test_api_host_composition_v1, test_job_worker_runtime_v1 — already clear CATALOG_DSN / QP_RUNTIME_DSN.
  • test_conformity_e2e — env resolution under clear=True; run/inspect are patched or pass an explicit DSN.
  • test_bybit_legacy_day_rebuild_v1 — uses its own variable name (REBUILD_TEST_DSN).
  • test_market_data_cli_v1, test_live_ingest_server_*, test_live_window_evidence_v1, test_golden_replay_e2e_v1 — executor / server injected, or refused before any connection.
  • tests/integration_*_postgres.py read DATA_GATEWAY_TEST_DSN, EXPERIMENT_TEST_DSN, CONFORMITY_EVIDENCE_DSN_* or the PG* environment by design; they are opt-in (not matched by run_tests.py's test_*.py glob) and are not changed.

Verification

  • python tests/test_l2_golden_v1.py — 26 OK, with and without CATALOG_DSN exported. With the old run_tool and CATALOG_DSN exported, 3 tests fail (red check).
  • python tests/test_promote_main_v1.py — the new test passes; it fails against the old script (red check). test_merge_stays_pinned_to_the_validated_oid_despite_a_concurrent_push fails identically on the unmodified implement/fid on Windows (the sneaky-push helper uses a /tmp path); unrelated.
  • compileall, git diff --check, tests/test_package_boundaries_v1.py pass. The full tools/run_tests.py was not run in this session.

Governance Note

  • No governance or planning file is touched; no secret added.

🤖 Generated with Claude Code

… off the exported catalog DSN (#536)

tools/l2_golden_e2e.py defaults --dsn to CATALOG_DSN, so the tool test ran the
catalog leg (a real publication) against whatever catalog the shell that runs
the suite exports. Seen during infra/promote-main.sh validation on the
operational host.

- test_l2_golden_v1: run_tool removes CATALOG_DSN around the tool; every test of
  the file trips on _catalog_leg; regression tests prove an exported DSN is never
  forwarded and the tool itself still honours CATALOG_DSN.
- promote-main.sh: the candidate suite runs with every PG* and *DSN* variable
  unset (names logged, never values); test_promote_main_v1 covers it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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