Add junit-xml output format#3453
Conversation
|
Hi @nitishagar! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Hey, can you rebase this change? I'm having trouble importing it because of the merge conflict in Cargo.lock. Thanks! |
Adds OutputFormat::JunitXml producing a JUnit-XML <testsuites> document so pyrefly's report can be consumed by CI dashboards. Hand-rolled writer with proper attribute and CDATA escaping; no new deps. Fixes facebook#3389
d4d08e7 to
e031e78
Compare
|
@samwgoldman Rebased onto latest main and resolved the Cargo.lock conflict, should be importable now. Thanks! |
|
@samwgoldman has imported this pull request. If you are a Meta employee, you can view this in D105751390. |
Summary
OutputFormat::JunitXml(--output-format junit-xml, oroutput-format = "junit-xml"inpyrefly.toml) emitting a JUnit-XML<testsuites>document.Json/Githubwriter pattern inpyrefly/lib/commands/check.rs. No new dependencies — hand-rolled XML escaping (attributes and CDATA, including]]>splitting).<testcase>per error, withclassnamecarrying the file path,namecarryingerror_kind:Lline, plusfileandlineattributes for CI dashboards that bucket per file.errorandwarnproduce<failure>entries (warnings rendered astype="warning");infoandignoreare dropped, matching the existing JSON writer.Fixes #3389
Test plan
cargo test -p pyrefly --lib— 5157/5157 passing locally (includes the two new tests for structure and escaping).cargo test -p pyrefly_config test_output_format_config_parsing— 1/1.test/errors.mdcovering--output-format junit-xml.