Repository navigation
Freeze the install-ID file loader's behaviour in fixtures - #53
Merged
Merged
Conversation
Adds the shared install-ID fixture corpus under src/test/resources/install-id-fixtures with an expected.txt measured against the 0.8.0 release, InstallIdFixturesTest to hold the loader to it, and VersionConsistencyTest to keep pom.xml, TraceClient.java and the README snippet on one version. The fixtures are stored as binary so CRLF, BOM and non-UTF-8 bytes survive exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fleet's release automation checks, before every release of a trace client, that the install-ID file loader still treats files written by earlier releases the same way. This PR adds what that check needs.
What was added
src/test/resources/install-id-fixtures/: the shared corpus of 20 install-ID files (the same corpus used for trace-client-python, minus the directory case git cannot hold), plusexpected.txt, which records the outcome for each one:loaded <id>,replacedorkept. A.gitattributesline marks the directorybinaryso CRLF, BOM and non-UTF-8 bytes are stored exactly (checked withgit show HEAD:…/crlf.id | xxdshowing0d0aandbom.idstartingefbbbf).InstallIdFixturesTest: fails if the*.idfiles and the filesexpected.txtnames differ. Each fixture is copied into a fresh temp directory and passed toTraceClient.installIdFromFile(File). Forloaded, the ID must match and the bytes must be unchanged. Forreplaced, the result must be a lowercase uuid4 and the file must now hold exactly that ID plus\n. Forkept, the bytes must be unchanged and the result must be a fresh uuid4 that is not in the file.VersionConsistencyTest: checks that the pom.xml project version matches thetrace-client X --header,VERSION = "X",TraceClient.VERSIONand the README<version>X</version>snippet, and that each of these appears exactly once.The client source and the version are unchanged.
Measured classification
Every line of
expected.txtwas measured, not assumed. A throwaway harness outside the repository ran the loader on each fixture, first at the0.8.0tag and then atmain. Both gave identical results:real-id), created, crlf, first-of-two (first-id), invalid-lines-first (third.is-valid), leading-blank-lines, max-length, padded, plain, tabs, trailing-newline, uppercase-uuid (case preserved)This matches trace-client-python's classification of the same corpus exactly. No differences were found.
Testing
mvn -B verifywas run locally on JDK 21: 128 tests, 0 failures. To confirm the new test catches changes, two deliberate breakages were tried and both made it fail: an extra unlisted fixture, and a wrong outcome line. CI runs the suite on Java 8, 17 and 21.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code