This is an archive of the discontinued LLVM Phabricator instance.

[lit] Include unexecuted tests in xUnit report
ClosedPublic

Authored by yln on Jun 5 2020, 3:56 PM.

Details

Summary

Pass in all discovered tests to report generators.

The XunitReport generator now creates testcase items for unexecuted
tests and documents why they have been skipped. This makes it easier
to compare test runs with different filters or configurations, or across
platforms.

I don't know who is using the JsonReport generator and what the
expectations there are (it doesn't have tests), so decided to preserve
the old behavior by filtering out the unexecuted tests.

Diff Detail

Event Timeline

yln created this revision.Jun 5 2020, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2020, 3:56 PM
yln edited the summary of this revision. (Show Details)Jun 5 2020, 4:03 PM
jdenny accepted this revision.Jun 8 2020, 7:23 AM

For xunit support, LGTM.

I also don't know whether junit support is worth testing. It might be good to wait a few days in case someone has an opinion on that.

llvm/utils/lit/tests/Inputs/xunit-output/pass.ini
6

Do you know why this results is never tested?

This revision is now accepted and ready to land.Jun 8 2020, 7:23 AM
yln marked 2 inline comments as done.Jun 8 2020, 1:01 PM

Thanks for the prompt review! I will wait for a week until landing this.

llvm/utils/lit/tests/Inputs/xunit-output/pass.ini
6

The only reason this is here is because the class DummyFormat from dummy_format.py (see above) expects this. This file has been copy&pasted :/ for a couple of tests and I wanted to avoid diverging this copy further. (I already added the required_feature property.)

The [results] part is used by one of the copies of the file in another test:
https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/tests/Inputs/test-data/metrics.ini#L6
https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/tests/test-data.py#L10

jdenny marked an inline comment as done.Jun 8 2020, 2:48 PM
jdenny added inline comments.
llvm/utils/lit/tests/Inputs/xunit-output/pass.ini
6

Ah, it seems I misgrepped and overlooked that. Thanks!

This revision was automatically updated to reflect the committed changes.
yln marked an inline comment as done.
yln added a comment.EditedJun 15 2020, 3:43 PM

This causes "unresolved tests" on one bot:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/26333/steps/ninja%20check%202/logs/stdio

Exception during script execution:
  Traceback (most recent call last):
  File "/home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/llvm/utils/lit/lit/worker.py", line 73, in _execute_test_handle_errors
  result = test.config.test_format.execute(test, lit_config)
  File "/home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/stage2/utils/lit/tests/Inputs/xunit-output/dummy_format.py", line 26, in execute
  required_feature = cfg.get('global', 'required_feature', fallback=None)
  TypeError: get() got an unexpected keyword argument 'fallback'