Repository navigation
fix: pass junit-to-ctrf integration options to the converter - #352
Merged
Merged
Conversation
The junit-to-ctrf integration's options (output, toolname, useSuiteName, env) were never passed to convertJUnitToCTRFReport, and the conversion ran even with "enabled": false. Map the options to the converter's, passing env as key=value strings, and skip the conversion when enabled is false. Closes #207
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.
Closes #207 (and #200, which was closed in favor of it).
The
junit-to-ctrfintegration'soptionsnever reached the converter. With the config from #207,outputwrote no file,toolnamewas ignored, andenvvalues likeappNamewere missing from the report, withbuildUrltaken from the GitHub run instead."enabled": falsedidn't turn the conversion off either.prepareReportnow mapsoutput,toolname,useSuiteNameandenvto junit-to-ctrf'soutputPath,toolName,useSuiteNameandenvProps, the last askey=valuestrings, which is the format it parses.enrichCurrentReportWithRunDetailsalready fills only blank fields, so onceenvgets through, the givenbuildUrlis kept and the GitHub context fills in the rest. No change was needed there."enabled": falsenow skips the conversion. A config with noenabledstill converts, as it does today: otherwise those workflows would quietly stop reporting (the XML is read as CTRF and the action exits with a warning). Happy to require"enabled": truelike the other integrations instead.Testing:
__tests__/ctrf/junit-integration.test.ts, the first tests for the JUnit path, using the existingjunit-to-ctrfmock. 3 of the 5 fail onmain(options, default options,enabled: false). The other 2 cover behavior that stays the same:envvalues survive enrichment, and a config with noenabledstill converts.npm testpasses on Node 24 and 26 (364 passed, 2 skipped).build:check,lint:checkandformat:checkpass, and lint shows the same 15 warnings asmain.ctrf-reports/test-junit.xmlwith the config from Bug: Integration with junit-to-ctrf does not use arguments #207. Onmainthere's no output file andbuildUrlcomes from the run. With this change the output file is written withtoolnameas the tool name, and the final report keepsappNameand the givenbuildUrl.dist/is rebuilt withnpm run packageon Node 26 and differs frommain's build only by this change.Written with Claude Code; I reviewed the changes and ran the full suite locally.