This is an archive of the discontinued LLVM Phabricator instance.

[lit] Add option to output test result as resultdb json format.
ClosedPublic

Authored by haowei on Aug 17 2021, 1:31 PM.

Details

Summary

This change adds an option --output-format=resultdb to allow llvm-lit generating JSON output for the test results, which can be better integrated with certain CI/CQ framework. This change does not alter the default behavior of llvm-lit when generating an output file.

Diff Detail

Event Timeline

haowei created this revision.Aug 17 2021, 1:31 PM
haowei requested review of this revision.Aug 17 2021, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 1:31 PM
yln added a reviewer: jdenny.Aug 17 2021, 2:32 PM

Hi Haowei,

Can you change this to be a new type of report instead of changing an existing one?
Look at TimeTraceReport for the recipe. Maybe --resultdb-output and ResultDbReport are appropriate names for parameter/class name?

This way the change would be purely additive and I then would be okay landing this as-is, i.e., without tests and documentation. It would then be "your problem" if we (upstream) break this functionality. This is only holds if my fellow reviewers think this okay as well, of course.

haowei updated this revision to Diff 367018.Aug 17 2021, 2:39 PM

Hi Haowei,

Can you change this to be a new type of report instead of changing an existing one?
Look at TimeTraceReport for the recipe. Maybe --resultdb-output and ResultDbReport are appropriate names for parameter/class name?

This way the change would be purely additive and I then would be okay landing this as-is, i.e., without tests and documentation. It would then be "your problem" if we (upstream) break this functionality. This is only holds if my fellow reviewers think this okay as well, of course.

I forgot to include the unit tests in the previous change, sorry about that. I was hoping to reuse the code instead of re-inventing the wheels but if adding a new type of report is what you strongly suggest, I can work on implementing that.

haowei updated this revision to Diff 367050.Aug 17 2021, 4:09 PM

Reimplemented into a dedicated class.

yln accepted this revision.Aug 18 2021, 1:42 AM

LGTM, I am happy with the patch: changes are now purely additive and include tests.

Please wait a week or so before landing to give others a chance to comment. Thanks! :)

This revision is now accepted and ready to land.Aug 18 2021, 1:42 AM