Fix XML parser dropping spaces between entity-decoded characters#47
Draft
paulboony wants to merge 3 commits intoMicroFocus:masterfrom
Draft
Fix XML parser dropping spaces between entity-decoded characters#47paulboony wants to merge 3 commits intoMicroFocus:masterfrom
paulboony wants to merge 3 commits intoMicroFocus:masterfrom
Conversation
When a handler's fillStep() cannot match the failed step name from the error/stack trace to any OctaneStep (due to name format differences, encoding, or parsing failures), all steps were incorrectly marked as PASSED. This adds a fallback in mergeScenario(): if all steps end up PASSED but the handler detected a test-case-level failure, the last step is marked FAILED with the error message. Adds getErrorMessage() to BddFrameworkHandler interface (with default empty implementation) and implements it in all 6 handlers to expose the test-case-level error message for the fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous fallback marked only the last step as failed when step name matching failed, leaving all prior steps as passed — including steps that should have been skipped. This violated the BDD invariant (passed* failed skipped*). Two-part fix: - Handlers: leave step status null (instead of defaulting to passed) when there is a failure but the step name cannot be matched. This applies to all 6 handlers (CucumberJs already had this behavior). - mergeScenario: rewrite as two-pass approach — fill all steps first, then find the failure point (explicit match > first null with error > last resort) and enforce the BDD invariant. Adds CucumberJs integration test proving the exact pass/pass/fail/ skip/skip pattern when passed steps are individually tracked but the failed step name has a mismatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The StAX parser emits entity references (e.g. > <) as separate Characters events. The space between them became a whitespace-only event that was silently dropped by the isWhiteSpace() filter in JunitReportReader. This caused step names like <Token A> <Token B> to be parsed as <Token A><Token B> breaking the exact-match step name comparison in handlers and causing the failure to be misattributed to the wrong step. Fix: remove the isWhiteSpace() filter and accumulate all Characters events. The handlers already split by newline and trim lines, so the extra formatting whitespace is harmless. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
JunitReportReaderemits entity references (>,<) as separateCharactersevents. Spaces between them (e.g.> <) became whitespace-only events that were silently dropped by theisWhiteSpace()filter. This caused step names containing angle brackets like<Token A> <Token B>to be parsed as<Token A><Token B>, breaking the exact-match step name comparison in handlers and misattributing the failure to the wrong step.mergeScenario()now enforces the BDD step status invariant (passed* failed skipped*) using a two-pass approach — fill steps first, then locate the failure point and apply the invariant.Test plan
testEntityEncodedAngleBracketsPreserveSpacestest verifies spaces between entity-decoded angle brackets are preserved🤖 Generated with Claude Code