Skip to content

test: guard the closed and open issues, with an issue-to-test matrix - #224

Open
amar-python wants to merge 12 commits into
mainfrom
claude/tests-issue-coverage
Open

amar-python wants to merge 12 commits into
mainfrom
claude/tests-issue-coverage

Conversation

@amar-python

@amar-python amar-python commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Tests for the closed and open issues, plus a matrix of which test guards which issue.

What's here

docs/ISSUE_TESTS.md: one row for each of the 69 issues (46 closed, 23 open): the test that fails if it comes back, or the reason there isn't one (decisions, docs, milestones not built, one machine's setup).

New tests

File Guards
tests/test_issue_regressions.py #175 uploader can't overwrite or mode-switch over a dataset · #178 distinct rows kept (incl. all 31 control characters) · #183 rate-limit identity · #189 T&E error row numbers
tests/test_tooling_issues.py #130 lock file · #169 catalogue fresh · #171 setup.sh keeps the old config · #180 · #181 · #182 bundle stops on a failed download · #194 coverage gate · #207 API doc defers to the served schema. The shell tests cut the real block out of each script and run it
tests/test_oidc_https_jwks.py #113 (what's testable offline): the https key fetch against a local TLS server, key rotation, no re-fetch inside PyJWT's cooldown, untrusted certificate refused
tests/test_open_issues.py #57 SECURITY.md · #60 offline scripts parse and stop on error
fe: tenant-isolation.test.tsx #176
e2e/ (Playwright, production build) #187, #188, #176, and the #154 Streamlit screen: role gating, edit with a required reason, exclude, history, sign-out leaves nothing for the next tenant

I re-introduced the original bug for #171, #175, #178, #181 (wrapper), #182, #183, #189 and the OIDC certificate check, and each test failed. The rest guard existing code.

One known failure, on purpose (strict, so it turns red when fixed)

#181 is only half fixed

The Tier S psql calls in evals/runner.py have no ON_ERROR_STOP; the fix is on the unmerged fix/181-sql-suite-exit-code branch. I first recorded this as an expected-fail pytest test, but CI's --strict report counts that as a skip and failed, so it is only noted in docs/ISSUE_TESTS.md.

Found by the browser tests

Every dynamic import in the React app showed as Failed since #202, though the server saved it: the app's schema didn't list the new header_mapping log step. Fixed separately in #223, which this branch merges so the suite runs against it; if #223 merges first this diff shrinks.

Not included, on purpose

Open issues #172, #173, #174, #184, #195, #168 and #167 already have tests in open PRs (#213, #208, #204, #214); duplicating them would collide when those merge. The matrix points at them.

Running


Generated by Claude Code

These closed issues had no behavioural test. Each test fails when the
original bug is put back (checked by hand for all four): key-prefix rate
limit identity, U+001F delimiter hashing, uploader overwrite and mode
switch over an existing dataset, and survivor-position T&E row numbers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
…207

Shell blocks are cut out of the real scripts and run (setup.sh config
write, run_tests.sh failure parse, build_bundle.sh download step), not
re-implemented. Re-introducing each original bug fails its test.

#181's second half (Tier S psql calls without ON_ERROR_STOP) is recorded
as a strict xfail: it is not on main.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
… scripts (#60)

#113: a local TLS server with a throwaway certificate exercises the real
PyJWKClient https fetch, key rotation past the refresh cooldown, no
re-fetch inside it, and refusal of an untrusted certificate. A sign-in
against the real IdP is still the manual step.

#57: SECURITY.md is on main with a reporting channel, which is the issue's
done-when. #60: the build and install scripts parse and stop on error and
the guide names them; the dry run itself stays manual.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
…w as Failed

#186 made the API return a header_mapping step in an upload's logs. The
React app's response schema did not list it, and the React app sends a
header mapping with every dynamic upload. zod rejected the whole response
("Unexpected response shape ... logs.3.step"), so an import that had
succeeded on the server was shown as Failed.

Add the step, export the schema, and test that it accepts every step the
API's loaders can pass to _log(), so the next new step fails a test, not
the upload screen.

Found by the browser end-to-end tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
…leak test

e2e/ drives the real API, the production build of the React app and the
Streamlit spike in Chromium. #187: a failed upload is listed and opens its
row errors. #188: no Stop once the request is on the server. #154: Streamlit
role gating, edit with a required reason, exclude, history, and sign-out
leaving nothing for the next tenant.

#176 is a strict expected failure, in vitest and in the browser: the leak
is live in the shipped app (a second tenant's history page lists the
first tenant's file). The browser tests are not part of the default run.

Found by these tests: every dynamic import showed as Failed (fixed in the
separate header_mapping PR, merged here so the suite runs on it).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
docs/ISSUE_TESTS.md has a row for each of the 69 issues (46 closed, 23 open):
the test that guards it, or why none can. Notes the two strict expected
failures (#176, #181 second half) and what the end-to-end run found.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
scripts/test_report.py --strict counts an expected failure as a skip and
fails the build ("unmet prerequisites must FAIL, not skip"). Remove the
strict xfail for the second half of #181 and record the gap in
docs/ISSUE_TESTS.md instead. #176's expected failures are vitest and
browser tests, which that step does not run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
@amar-python
amar-python marked this pull request as ready for review November 9, 2026 14:37
The Windows job runs every unit-marked test, and `bash` there is not a
POSIX shell, so the tests that run the repo's real shell blocks, plus
`bash -n` and the catalogue check, failed. Add a `tooling` marker for
them (Linux jobs and local runs) and leave the pure-Python tests as unit.

The coverage-gate test also failed on Windows: the script prints
box-drawing characters and a Windows console's default encoding can't.
The test now runs it with UTF-8 output.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
…verage

# Conflicts:
#	docs/TEST_CASES.md
#	pytest.ini
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011T6Wqi8yaiaYWUVH8C4QAY
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.

2 participants