Skip to content

test: export the prefix table and v2 mappings as goldens; dump v2 documents per dataset - #223

Merged
kiivihal merged 3 commits into
mainfrom
test/conformance-exports
Nov 22, 2026
Merged

kiivihal merged 3 commits into
mainfrom
test/conformance-exports

Conversation

@kiivihal

Copy link
Copy Markdown
Member

What

Three test-only additions around the v2 conformance suite. No production code changes.

  • Prefix table and v2 mappings as goldens. namespace/testdata/namespaces.json (the default prefix table) and mapping/testdata/v2-mapping.json / v2-mapping-update.json are written by golden tests. A change to either now shows up as a reviewable diff, and other tools can read them as data instead of parsing Go source.
  • TestDumpV2 (ikuzo/service/x/bulk/dump_test.go). Opt-in via HUB3_DUMP_IN=<bulk.ndjson> HUB3_DUMP_OUT=<dump.ndjson> (optionally HUB3_DUMP_RDFTAG=<toml>). It runs each request through the same path as the conformance suite and writes one line per record: {"hubID","doc"} or {"hubID","kind"} for a refusal. That makes whole datasets comparable between two indexing runs. Skipped when the variables are unset.
  • A record that processes without error but emits zero or several index messages gets a kind in the dump and fails the test, instead of producing a line with neither document nor kind.

Testing

  • go test ./ikuzo/service/x/namespace/ ./ikuzo/driver/elasticsearch/internal/mapping/: pass; the goldens match the current table and mappings.
  • go test -run 'TestConformance|TestDumpV2' ./ikuzo/service/x/bulk/: pass (TestDumpV2 skips without its variables).
  • TestDumpV2 was run on full datasets (the largest 328,743 records).

A change to either now shows up as a reviewable diff, and other tools
can read them as data instead of parsing Go source.
Opt-in via HUB3_DUMP_IN/HUB3_DUMP_OUT: runs each request through the same
path as the conformance suite and writes the document or refusal kind per
record, for comparing whole datasets.
A record that processes without error but emits zero or several index
messages now gets a kind in the dump and fails the test, instead of a
line with neither document nor kind.
@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.95%. Comparing base (1963737) to head (e99903c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
- Coverage   36.96%   36.95%   -0.01%     
==========================================
  Files         414      414              
  Lines       38326    38326              
==========================================
- Hits        14167    14165       -2     
- Misses      24157    24159       +2     
  Partials        2        2              
Flag Coverage Δ
unittests 36.95% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kiivihal
kiivihal merged commit 9ea9463 into main Nov 22, 2026
6 checks passed
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.

1 participant