fangorn/ex_git_objectstore
public
ref:176c8af20558ccb4dfc01c65c63d0d34db9eeb6b
test: close audit gaps — strengthen assertions, drive telemetry via real git
Four items from the branch audit, landed together:
1. Filter integration tests (blob:none, tree:0, object:type=commit,
combine, sparse:oid) now assert directly on pack contents via
`git cat-file --batch-check --batch-all-objects`. Earlier
versions passed if the server merely advertised `filter` and
returned code 0 — a full pack from a filter-ignoring server
would have slipped through. New helpers
`count_local_objects_by_type/1`, `local_object_shas/1`, and
`assert_promisor_configured/1`. `--no-checkout` is used so
post-clone lazy-fetches don't pollute the counts.
2. "Concurrent fetch and push" test was running on two separate
daemon ports, so nothing actually raced. Replaced with two
tests that hit shared state:
a. two concurrent clones against the SAME upload-pack port —
forces the accept loop to spawn two independent handlers
and asserts both produce matching HEADs.
b. clone + push against the same shared repo (upload-pack and
receive-pack daemons pointing at one Memory backend) —
asserts both operations complete, the ref landed, and
`git fsck` on the clone is clean.
3. "hook_rejected" detail-preservation test was ignoring the push
exit code (`{out, _code}`). Now asserts `refute code == 0` and
also that the target ref was not moved on the server.
4. Atomic-receive-pack telemetry test was poking at a
`%ReceivePack{}` struct directly to trigger the span. Rewritten
to drive the real TCP daemon with a `git push --atomic`
subprocess, so the telemetry path executes exactly as it does
in production.
All 798 tests pass.
SHA:
176c8af20558ccb4dfc01c65c63d0d34db9eeb6b
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-19 01:43
Parents:
86dbb1b
4 files changed
+229
-74
| Type | ||
|---|---|---|
|
|
test/ex_git_objectstore/protocol/telemetry_test.exs | +39 −32 |
|
||