This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Register result codes with lit.
ClosedPublic

Authored by Meinersbur on Apr 28 2020, 8:15 PM.

Details

Summary

lit has a hard-coded set of result codes, but their semantics don't
match with what we want to express in the test suite:

  • NOCHANGE: Executable Unchanged
  • NOEXE: Executable Missing

5c244115c98a simplified registration of custom result codes. Calling
add_result_category() is no longer necessary.

While this does not fix any buildbot (such as http://lab.llvm.org:8011/builders/clang-native-arm-lnt-perf), it at least should allow lit to display which tests have failed at the end.

Event Timeline

Meinersbur created this revision.Apr 28 2020, 8:15 PM
  • Missing Executables -> Executable Missing

When reporting test codes, lit appends " Test" to the category name.
I think "Executable Missing Tests" is better than "Missing Executables Tests".

yln accepted this revision.Apr 28 2020, 10:11 PM
This revision is now accepted and ready to land.Apr 28 2020, 10:11 PM
yln added inline comments.Apr 29 2020, 9:49 AM
litsupport/test.py
16–17

Actually, I thought that the semantics of lit's skipped differ from test-suite's skipped?!
https://reviews.llvm.org/D77986#1979402

  • Rename SKIPPED to UNCHANGED
Meinersbur added a comment.EditedApr 29 2020, 9:25 PM

Note I could not confirm that the regression tests are working. litsupport-tests has a run.sh which does not work. I changed its references to SKIPPED anyway.

I can make lit emit "Executable Unchanged Tests" during a regular run (using -Dprevious=/path/to/lit-output.json), but running tests seem to been serialized, the llvm-lit processes using tens of GBs of memory and as a result being slower than just running the tests.

I don't have significant experience with LNT or test-suite, so I doubt I'm the right person to respond to your issues here.

Given that this patch is currently accepted, I wonder if clicking "Request Review" in phabricator would help to attract the attention of other reviewers.

jdoerfert accepted this revision.May 13 2020, 10:14 AM

LGTM. Thanks for fixing this @Meinersbur and @yln !

Just as a heads up, it seems that this commit breaks anyone using the lit in pypi. (https://pypi.org/project/lit/)

If you try using pypi's lit with this commit (say by running the test suite with LNT), you'll get

AttributeError: 'function' object has no attribute 'add_result_category'

Would it be possible to temporarily back this out until that lit has been updated? (cc: @tstellar @ddunbar)

Just as a heads up, it seems that this commit breaks anyone using the lit in pypi. (https://pypi.org/project/lit/)

If you try using pypi's lit with this commit (say by running the test suite with LNT), you'll get

AttributeError: 'function' object has no attribute 'add_result_category'

Would it be possible to temporarily back this out until that lit has been updated? (cc: @tstellar @ddunbar)

What change do we need to pull into the pypi lit to fix this?

Just as a heads up, it seems that this commit breaks anyone using the lit in pypi. (https://pypi.org/project/lit/)

If you try using pypi's lit with this commit (say by running the test suite with LNT), you'll get

AttributeError: 'function' object has no attribute 'add_result_category'

Would it be possible to temporarily back this out until that lit has been updated? (cc: @tstellar @ddunbar)

What change do we need to pull into the pypi lit to fix this?

Looks like rGfbdcfcd4c392c487c411632b951f4aada351154e should do the trick.

Just as a heads up, it seems that this commit breaks anyone using the lit in pypi. (https://pypi.org/project/lit/)

If you try using pypi's lit with this commit (say by running the test suite with LNT), you'll get

AttributeError: 'function' object has no attribute 'add_result_category'

Would it be possible to temporarily back this out until that lit has been updated? (cc: @tstellar @ddunbar)

What change do we need to pull into the pypi lit to fix this?

Looks like rGfbdcfcd4c392c487c411632b951f4aada351154e should do the trick.

I was hoping this would be a bug fix, but it looks more like a feature. We were planning to update lit on pypi for the 10.0.1 release, but this doesn't look like a good backport candidate to me. Can we work-around this in the test suite somehow?

yln updated this revision to Diff 271445.Jun 17 2020, 12:22 PM

ResultCode has a self-registering constructor now, calling
add_result_category() is no longer necessary. See 5c244115c98a.

yln edited the summary of this revision. (Show Details)Jun 17 2020, 12:25 PM
In D79064#2098947, @yln wrote:

ResultCode has a self-registering constructor now, calling
add_result_category() is no longer necessary. See 5c244115c98a.

Given the change:

-    def __init__(self, name, isFailure):
+    def __init__(self, name, label, isFailure):

every program using the two-argument ResultCode constructor will fail now? I also see the add_result_category has been removed entirely, and llvm-test-suite has not received an update.

yln added a comment.Jun 17 2020, 4:14 PM

and llvm-test-suite has not received an update.

Can we land this change or should I revert the lit change?

yln closed this revision.Jun 17 2020, 5:05 PM

Obsoleted.