Repository navigation
test(2.0): move root components in invalid fixtures to the 2.0 layout - #1251
Merged
jkowalleck merged 1 commit intoNov 25, 2026
Merged
jkowalleck merged 1 commit into
jkowalleck merged 1 commit into
Conversation
Nine invalid 2.0 fixtures still placed components at the BOM root, which the 2.0 root schema rejects via unevaluatedProperties. They were therefore rejected before the constraint each one targets was evaluated. Move their components to definitions.components or inventories[0].components, matching their valid siblings. No other content changes. Signed-off-by: Mehrn0ush <[email protected]>
bhess
reviewed
Nov 25, 2026
bhess
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Mehrn0ush , I've looked mainly at the crypto-related one and this one looks good to me.
jkowalleck
approved these changes
Nov 25, 2026
Member
|
thank you so much for fixing these misleading and wrong negative/invalid examples. |
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.
Problem
Nine invalid 2.0 test fixtures still put
componentsat the root of the BOM. The 2.0 root schema has no rootcomponentsproperty and setsunevaluatedProperties: false, so every one of them is rejected withmust NOT have unevaluated properties [components]before the schema ever checks the defect the fixture was written for.The suites pass because they only check that an invalid fixture is rejected, not why it is rejected. As a result, these fixtures don't test anything:if the constraint each one targets were removed or broken, the fixture would still be rejected and the tests would stay green.
The fixtures came in with the AI/ML and measurements work merged in 3714a38. In that merge, the matching valid fixtures (
valid-ai-ml-*,valid-measurements-2.0.json,valid-cryptography-protocol-type-2.0.json) were moved to the 2.0 layout, but these invalid ones were not.Change
Each fixture's
componentsarray moves to where its valid sibling puts it:invalid-ai-ml-energy-unit-2.0.jsondefinitions.componentsMWhis not an allowed energy unitinvalid-ai-ml-energy-unit-object-2.0.jsondefinitions.componentsinvalid-ai-ml-legacy-modelcard-2.0.jsondefinitions.componentsmodelCardon a componentinvalid-ai-ml-task-casing-2.0.jsondefinitions.componentsSummarization(wrong casing)invalid-ai-ml-unit-custom-missing-name-2.0.jsondefinitions.componentsnameinvalid-ai-ml-unit-unknown-symbol-2.0.jsondefinitions.componentsfurlongsinvalid-custom-unit-rec20-code-2.0.jsondefinitions.componentsunece-rec20code that is not a REC 20 codeinvalid-measure-unit-missing-2.0.jsondefinitions.componentsactivityEnergyCostwithoutunitinvalid-cryptography-protocol-type-2.0.jsoninventories[0].components, with the same subject asvalid-cryptography-protocol-type-2.0.jsontype: "other"The component objects and all other content are unchanged. The line diff is large only because the moved arrays are re-indented;
git diff -wshows the structural change.invalid-inventory-old-root-components-2.0.jsonis intentionally left alone: rootcomponentsis the defect it tests.Verification
componentsarray deep-equals the original, and the rest of the document deep-equals the original minuscomponents.MWhtokWh,othertotls,Summarizationtosummarization). The same check against thecurrent2.0-devfixtures fails for all nine: they stay invalid after therepair, because rootcomponentsstill rejects them.test:v2.0, including the bundled schemas (TEST_BUNDLED=true):**the validate, semantic and functional suites pass with 0 errors.schema-v2.0: 318 tests, 0 failures, 0 errors.Not in this PR
invalid-formulation-envVars-2.0.jsonalso has rootcomponents, and hascomponentsinsideformulation[0]as well. It already fails for its intended reason (environmentVars), so it is not a no-op test, and I left it out to keep this change mechanical.Separately, the suites could assert the expected error for each invalid fixture, which would catch this kind of drift automatically. That is a largerchange to the test harness.
Thanks @bhess