Repository navigation
Add --junit-xml and --json-results report output to validate and test - #192
Merged
Merged
Conversation
Both commands can now write machine-readable reports through a shared report_writer. A placeholder error report is written before a run and replaced on completion, and a timeout writes a timed-out report, so a report always agrees with the exit code. A report that can't be written fails the run.
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
pluginval validateandpluginval testcan now write machine-readable reports, for CI systems that display per-test results and for scripts.--junit-xml <file>JUNIT_XML--json-results <file>JSON_RESULTSBoth are off by default. Relative paths resolve against the working directory and parent directories are created. The text output, log files and
test's JSON on stdout are unchanged.How it works
source/ReportWriter.h/.cpp(report_writer): one neutralReportmodel,toJUnitXml(),toJson()andwrite(). Each command converts its own results into it.validate: the options are ordinary settings, so env vars,--configand the child-process handoff work. The report is written inrunTests()inValidator.cpp, one test case per pluginval test.test: the options are parsed insettings_parser::dispatch(). The existing result JSON is included in the JSON report underdetails.1).Testing
CommandLineTests.cppfor option parsing (CLI, env,--config, child round-trip) and the writer (XML parsed back, escaping, JSON summary, file output).pluginval.acceptance.*CTest cases now pass both options, so the write path runs in the acceptance workflow on all three platforms.pluginval run-testspasses and the acceptance CTest run passes 5/5. Checked by hand for both commands: success, failure, error, timeout, env vars and an unwritable report path; reports validate withxmllint/jqand agree with the exit code.Docs
docs/Adding pluginval to CI.md(new "Machine-readable reports" section),docs/Command line options.md,docs/Acceptance testing.md,CHANGELIST.mdandCLAUDE.md.