Skip to content

test: fail loud when the golden corpus is missing#19

Merged
dfa1 merged 2 commits into
mainfrom
test/golden-corpus-fail-loud
Jun 26, 2026
Merged

test: fail loud when the golden corpus is missing#19
dfa1 merged 2 commits into
mainfrom
test/golden-corpus-fail-loud

Conversation

@dfa1

@dfa1 dfa1 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Make a missing golden corpus (the vendored third_party/zstd/tests submodule) fail loudly with a helpful message, at two levels:

Build-time (primary): a maven-enforcer requireFilesExist rule in the integration-tests module, bound to validate. If the submodule isn't checked out, the build fails before compiling/testing with:

The golden corpus is missing: third_party/zstd/tests was not found.
These integration tests read the vendored zstd submodule. Check it out with:

    git submodule update --init --recursive

then re-run the build.

Runtime (backstop): locateCorpus() now throws IllegalStateException (with the same hint) instead of returning null, which filesIn had turned into an empty stream — silently skipping every golden test while staying green. Drops the dead TESTS == null guard. Covers direct/IDE test runs that bypass the enforcer.

Test

  • ./mvnw -pl integration-tests validate — enforcer rule passes (corpus present).
  • ./mvnw -pl integration-tests -am test -Dtest=GoldenCorpusTest — 18 green.

🤖 Generated with Claude Code

dfa1 and others added 2 commits June 26, 2026 22:01
locateCorpus returned null when third_party/zstd/tests was absent, and
filesIn turned that into an empty stream — so a missing submodule
silently skipped every golden test and still went green. Throw instead:
the corpus is the vendored zstd submodule, so its absence is a setup
error worth surfacing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add maven-enforcer requireFilesExist on third_party/zstd/tests in the
integration-tests module, bound to validate. A missing submodule now
fails the build up front with a message telling the user to run
'git submodule update --init --recursive', instead of failing later.
The runtime IllegalStateException stays as a backstop for direct/IDE runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 7cfcfe9 into main Jun 26, 2026
1 check passed
@dfa1 dfa1 deleted the test/golden-corpus-fail-loud branch June 26, 2026 20:05
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