Repository navigation
test: export the prefix table and v2 mappings as goldens; dump v2 documents per dataset - #223
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Three test-only additions around the v2 conformance suite. No production code changes.
namespace/testdata/namespaces.json(the default prefix table) andmapping/testdata/v2-mapping.json/v2-mapping-update.jsonare 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 viaHUB3_DUMP_IN=<bulk.ndjson> HUB3_DUMP_OUT=<dump.ndjson>(optionallyHUB3_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.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 (TestDumpV2skips without its variables).TestDumpV2was run on full datasets (the largest 328,743 records).