Skip to content

fix: Restore composition error cap that stops collecting, not iterating (#54) - #75

Open
shadowhand wants to merge 1 commit into
duyler:mainfrom
shadowhand:fix/54-restore-composition-cap-after-merge
Open

shadowhand wants to merge 1 commit into
duyler:mainfrom
shadowhand:fix/54-restore-composition-cap-after-merge

Conversation

@shadowhand

Copy link
Copy Markdown
Contributor

Problem

CompositionBranchOrderIndependenceTest fails on main (3 tests). The #54 fix (8edf71a) was undone by merge 5560ac4: resolving a conflict in AbstractCompositionalValidator::validateSchemas() kept the early return at MAX_COMPOSITION_ERRORS. Branches after the cap were never evaluated, so anyOf/oneOf could miss a later matching branch and report "none did".

Fix

Only error collection stops at the cap ($capped flag); every branch is still evaluated and counted. Output is unchanged: 20 errors plus one TooManyErrorsError.

allOf now reports the true number of failed branches. all_of_still_fails_when_a_branch_after_the_error_cap_fails expected 2 failed from the old counting, which only counted branches whose errors were collected before the cap. Three branches fail there, so it now expects 3 failed.

Verification

Full PHPUnit suite and psalm pass locally. Added a CHANGELOG entry under [Unreleased].

Refs #54

…ng (duyler#54)

Merge 5560ac4 resolved a conflict in AbstractCompositionalValidator by
keeping the early return at the error cap, undoing 8edf71a. Branches after
the cap were never evaluated, so anyOf/oneOf could miss a later match and
CompositionBranchOrderIndependenceTest failed on CI.

Only error collection now stops at the cap. allOf counts every failed
branch, so its test expects 3 failed rather than 2.
@shadowhand

Copy link
Copy Markdown
Contributor Author

Build is failing because of a Sonar auth issue, perhaps an expired token. Nothing I can do about it.

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