Skip to content

test: add identity property tests and full-chain otlp e2e#110

Merged
AKogut merged 1 commit into
mainfrom
feat/103-test-depth
Jul 18, 2026
Merged

test: add identity property tests and full-chain otlp e2e#110
AKogut merged 1 commit into
mainfrom
feat/103-test-depth

Conversation

@AKogut

@AKogut AKogut commented Jul 18, 2026

Copy link
Copy Markdown
Owner

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

  • Property tests (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; normalizeFilePath is idempotent; hashParams is key-order independent; parameterized variants stay distinct.
  • Full-chain E2E (2 tests, real Postgres): the SDK exports real OTLP to a live API server → durable queue → worker → asserts the resulting rows (run, executions with retry linkage, identity, flaky score with reason codes) and the emitted run.processed event. The second test covers history accumulating across runs and idempotency on re-delivery.
  • buildApp is now a separate @flakemetry/api/app entry so it can be imported without side effects (importing index.ts used 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

  • core: 22 tests (7 new property tests)
  • worker: 11 tests (2 new E2E against real Postgres)
  • full turbo pipeline green, 38/38 tasks

@AKogut AKogut self-assigned this Jul 18, 2026
@AKogut
AKogut merged commit 4a02a7c into main Jul 18, 2026
2 checks passed
@AKogut
AKogut deleted the feat/103-test-depth branch July 18, 2026 11:33
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.

Test depth: property tests for identity + full-chain E2E

1 participant