Skip to content

test: drive verify end to end with real pytest and tgtrace in CI (#114) - #164

Merged
inth3shadows merged 2 commits into
mainfrom
test/114-e2e-verify
Oct 30, 2026
Merged

inth3shadows merged 2 commits into
mainfrom
test/114-e2e-verify

Conversation

@inth3shadows

Copy link
Copy Markdown
Owner

Fixes #114.

  • tests/test_verify_e2e.py builds a temp target repo whose committed diff selects J1, then runs verify.run with real pytest and tgtrace for each shape the audit fixed: pass 0, fail 1, skip in the body 3, xfail 3, setup error 1, parametrized id containing :: 0, declared but never entering the journey 3. Each case also pins which path it took, not just its exit code.
  • An unmarked red test pins verify's -m journey filter.
  • The pytest subprocess runs with plugin autoload off and an empty PYTEST_ADDOPTS.
  • CI: pytest pinned to 9.0.3 in unittest-with-pytest, and that job sets TG_REQUIRE_PYTEST=1 so a missing pytest fails it instead of skipping the file.

Reviewed by /code-review and a code-reviewer agent (CI replica in a clean venv, 44 mutants). The four gaps that let the test stay green are fixed in f6ccfc2; the rest are filed as #163.

Every other verify test fakes the pytest run, so tgtrace's hooks, the
JUnit join and verify.run's trace handling were never exercised
together; the unittest-with-pytest job installed pytest and ran a suite
that never needed it.

tests/test_verify_e2e.py builds a temp target repo whose committed diff
selects J1 and runs verify.run with real pytest for each shape the audit
fixed: pass 0, fail 1, skip in the body 3, xfail 3, setup error 1,
parametrized id containing `::` 0, declared but never entering the
journey 3. Skipped without pytest. Each case gets a fresh test file and
no bytecode: a same-size rewrite within one second reused a stale .pyc.

CI pins pytest==9.0.3 in that job, since the test asserts pytest's JUnit
and nodeid shapes.
…en (#114 review)

- H1: an unmarked red test beside the J1 test pins verify's `-m`
  journey filter; dropping it survived because every test covered J1.
- H2: the unittest-with-pytest job sets TG_REQUIRE_PYTEST=1, and a
  presence test fails there if pytest is not importable instead of
  skipping the file into a green job.
- H3: each case pins which path it took (credited / incomplete reason /
  uncovered / unvalidated), not just the exit code, since three paths
  all end in exit 3.
- H4: the pytest subprocess gets PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 and an
  empty PYTEST_ADDOPTS, so a developer's `-n auto`, pytest-cov or
  pytest-randomly cannot change the run.
@inth3shadows
inth3shadows merged commit a46677a into main Oct 30, 2026
5 checks passed
@inth3shadows
inth3shadows deleted the test/114-e2e-verify branch October 30, 2026 18:54
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.

CI: add an end-to-end verify test that drives real pytest + tgtrace

1 participant