test: add identity property tests and full-chain otlp e2e#110
Merged
Conversation
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.
Closes #103
Summary
Closes the last review gap: #18 asked for property tests (only example-based existed) and no single test exercised the whole write path — every stage was tested in isolation.
Changes
fast-check, 7 identity invariants): a moved file resolves to the same identity for any pair of paths; a changed title is a different identity even at the same path; resolution works through an alias recorded by an earlier move;normalizeFilePathis idempotent;hashParamsis key-order independent; parameterized variants stay distinct.run.processedevent. The second test covers history accumulating across runs and idempotency on re-delivery.buildAppis now a separate@flakemetry/api/appentry so it can be imported without side effects (importingindex.tsused to start the server).A flaky test, caught and fixed properly
The first version of the E2E was itself flaky: a single
tick()occasionally missed a just-enqueued job. Investigated rather than retried — this is not a production bug, because the real worker polls in a loop and would pick the job up on the next poll. The fix was to the test design (a bounded drain loop mirroring real worker behaviour), not a retry papering over the race. Stable across repeated runs.Testing