test: api round-trip expects mx's attribution stamp instead of stripping it#232
Merged
Conversation
…ing it mx stamps its provenance <software> into <identification>/<encoding> on every api write (core::withStamp via serializeWithAttribution) -- an intended feature, not a bug. The round-trip harness used to strip the stamp from the output before comparing, which left behind an empty <encoding>/<identification> shell the source never had, so a file with no identification failed with a spurious add. Expect the stamp instead of stripping it: add the same stamp to the expected (original) document so both sides carry it. The comparison now asserts the stamp is present and in its schema-correct slot -- a write that drops or misplaces it fails. This matches the decision that stamping is intended output. Unblocks three files whose only divergence was the stamp shell; pin them in the baseline. Closes #226
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 72.7% | 5432 / 7468 |
| Functions | 60.3% | 1831 / 3034 |
| Branches | 43.7% | 4538 / 10375 |
Core HTML report | API HTML report
Commit 022067fd629a4dc2f22d4495b9b2bb5403f84fbd.
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.
Summary
Resolves #226. mx stamps its provenance
<software>into<identification>/<encoding>on every api write (core::withStampviaserializeWithAttribution) — an intended feature, not a bug. The round-trip harness previously stripped the stamp from the output before comparing, which left behind an empty<encoding>/<identification>shell the source never had, so any file lacking an identification failed with a spurious add (the single biggest blocker on the corpus).This makes the harness expect the stamp instead of stripping it: it adds the same stamp to the expected (original) document so both sides carry it. The comparison now asserts the stamp is present and in its schema-correct slot — a write that drops or misplaces it fails.
addMxAttributionmirrorscore::withStamp(create identification/encoding in schema position if absent, drop any prior mx stamp, append the current one last), so a source that already carries an mx stamp (e.g. k016a) is handled too.Unblocks three corpus files whose only divergence was the stamp shell, now pinned in
roundtrip-baseline.txt:Testing
mxtest-api-roundtrip regressionover the pinned baseline: 4 passed, 0 failedclang-format --Werrorclean on the changed fileReferences