Repository navigation
Freeze the install-ID file loader's behaviour in fixtures - #38
Merged
Merged
Conversation
test/install-id-fixtures holds the shared corpus of hand-written ID files, and expected.txt records what installIdFromFile does with each at 0.4.0 (loaded <id>, replaced or kept). installIdFixturesLoadAsReleased checks every line and that expected.txt names exactly the fixtures present, so an ID a release stored keeps loading as the same ID. theVersionIsTheSameEverywhere checks the header banner, TRACE_CLIENT_VERSION and the README's User-Agent against CMakeLists.txt. .gitattributes stores the fixtures as binary so CRLF, BOM and non-UTF-8 bytes survive checkout; the Makefile and CMakeLists.txt pass the source directory so MSVC finds them from build\Release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeumA4DYW41mYg7nCwNn
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.
What
test/install-id-fixtures/: the shared corpus of 20 install-ID files, plusexpected.txtrecording whatTraceClient::installIdFromFiledoes with each one (loaded <id>,replacedorkept)..gitattributesmarks the directory binary so the CRLF, BOM and non-UTF-8 bytes are stored and checked out exactly.installIdFixturesLoadAsReleasedintest/test_trace_client.cpp: copies each fixture into a fresh temp directory, calls the loader there and asserts the outcome (loaded: the ID is returned and the bytes are unchanged; replaced: a lower-case uuid4 is returned and the file is now exactly that plus\n; kept: the bytes are unchanged and a uuid4 not in the file is returned). It fails ifexpected.txtand the*.idfiles in the directory disagree.theVersionIsTheSameEverywhere: the version inCMakeLists.txtmust appear exactly once in each of the header bannertrace-client X (C++) --,#define TRACE_CLIENT_VERSION "X"and the README'strace-client-cpp/X (.CXXFLAGS, so the sanitizer job's override keeps it) andCMakeLists.txtdefineTRACE_CLIENT_SOURCE_DIR, so the fixtures are found frombuild\Releaseunder MSVC.expected.txtline.No change to
trace_client.hppor to the version.Why
The fleet's release automation will check, before every release, that every released fixture stays byte-identical, that every released
loadedandkeptline ofexpected.txtstays unchanged, and that CI (which runs this test) is green on the tagged commit. An ID a previous release stored must keep loading as the same ID, and an unreadable file must never be overwritten.Measured classification
Each line was measured, not assumed: a throwaway harness outside the repository ran every fixture through
installIdFromFileat tag 0.4.0 and again atmain(96439f5); the results were identical.real-id), created, crlf (crlf-id), first-of-two (first-id), id-then-not-utf8 (good-id), invalid-lines-first (third.is-valid), leading-blank-lines, max-length, padded, plain, tabs, trailing-newline, uppercase-uuidDifferences from trace-client-python on the same corpus: the C++ loader reads bytes and does not decode UTF-8, so
not-utf8.idis replaced (Python: kept) andid-then-not-utf8.idis loaded asgood-id(Python: kept). No fixture in the corpus iskepthere; the test still implements that outcome.Testing
make testwith g++ 9 at-std=c++11,c++17andc++2a: 83 tests, 0 failed checks.make test-libcurl: passes./(not the source tree): both new tests pass, confirming the fixture path resolves independently of the working directory.expected.txtline was changed, an unlisted.idfile was added, and the README version was altered.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code