Fix misleading 'XML could not be parsed.' message for non-label targets (directories)#1533
Open
jordanpadams wants to merge 1 commit intomainfrom
Open
Fix misleading 'XML could not be parsed.' message for non-label targets (directories)#1533jordanpadams wants to merge 1 commit intomainfrom
jordanpadams wants to merge 1 commit intomainfrom
Conversation
Report.lidvid() was returning 'XML could not be parsed.' as its default value, which was shown for any non-label target (e.g. directories) that cannot have XML to parse. Now returns empty string for non-labels so no parenthetical is shown, reserves 'LIDVID could not be extracted.' for actual label files where LIDVID extraction fails, and FullReport skips the parenthetical entirely when lidvid is empty. Fixes #1510 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
nutjob4life
approved these changes
Mar 20, 2026
Member
nutjob4life
left a comment
There was a problem hiding this comment.
Code delta: ✓
Maven tests: ✓
Approval: ✅
Maven details:
292 scenarios (292 passed)
876 steps (876 passed)
10m 53.787s
Mar 20, 2026 11:08:05 AM org.junit.platform.launcher.core.DiscoveryIssueNotifier logIssues
WARNING: TestEngine with ID 'cucumber' encountered a non-critical issue during test discovery:
(1) [WARNING] Discovering tests using the cucumber.features property. Other discovery selectors are ignored!
This is a work around for the limited JUnit 5 support in Maven and Gradle. Please request/upvote/sponsor/ect better support for JUnit 5 discovery selectors. For details see: https://github.com/cucumber/cucumber-jvm/pull/2498
If you are using the JUnit 5 Suite Engine, Platform Launcher API or Console Launcher you should not use this property. Please consult the JUnit 5 documentation on test selection.
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 653.9 s -- in io.cucumber.junit.platform.engine.CucumberTestEngine
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 23
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:22 min
[INFO] Finished at: 2026-03-20T11:08:05-05:00
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
Fix misleading
(XML could not be parsed.)parenthetical appearing in report output for directories and other non-label targets when running--rule pds4.bundleorpds4.collection.Root cause:
Report.lidvid()used"XML could not be parsed."as its default return value. For non-label targets (directories),TargetExaminer.isTargetALabel()returnsfalseimmediately, leaving the default string in place — even though no XML was ever attempted.Changes:
Report.java: Return""for non-label targets; reserve"LIDVID could not be extracted."for actual label files where LIDVID extraction fails (more accurate, sinceisTargetALabel()already confirms the XML is parseable before extraction is attempted)FullReport.java: Skip the(lidvid)parenthetical entirely when lidvid is emptyBefore:
After:
⚙️ Test Data and/or Report
Manually verified logic by tracing
TargetExaminer.isTargetALabel()andgetTargetContent()behavior. Existing test suite passes (mvn compileclean). A dedicated regression test scenario can be added undersrc/test/resources/github1510/if desired.♻️ Related Issues
Fixes #1510
🤓 Reviewer Checklist
TargetExaminer—isTargetALabel()confirms XML parseable before entering the extraction branch