-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[lit] Optionally exclude xfail tests #151191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lit] Optionally exclude xfail tests #151191
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@llvm/pr-subscribers-testing-tools Author: Mircea Trofin (mtrofin) ChangesSee the related issue. We want to set up a build bot where In that setup, we will also ignore This PR adds support for that. It is intentionally unsophisticated - e.g. doesn't support "free range" regex - because the motivating scenario doesn't justify that; we can expand that if needed later. Issue #147390 Full diff: https://github.com/llvm/llvm-project/pull/151191.diff 2 Files Affected:
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index 0939838b78ceb..2f22c7ef1d053 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -238,7 +238,11 @@ def mark_xfail(selected_tests, opts):
test_full_name = t.getFullName()
if test_file in opts.xfail or test_full_name in opts.xfail:
t.xfails += "*"
- if test_file in opts.xfail_not or test_full_name in opts.xfail_not:
+ if (
+ test_file in opts.xfail_not
+ or test_full_name in opts.xfail_not
+ or opts.xfail_not == ["*"]
+ ):
t.xfail_not = True
diff --git a/llvm/utils/lit/tests/xfail-cl.py b/llvm/utils/lit/tests/xfail-cl.py
index ef1bb0414cfea..b82fb87847c41 100644
--- a/llvm/utils/lit/tests/xfail-cl.py
+++ b/llvm/utils/lit/tests/xfail-cl.py
@@ -5,11 +5,21 @@
# RUN: %{inputs}/xfail-cl \
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
+# RUN: %{lit} --xfail 'false.txt;false2.txt;top-level-suite :: b :: test.txt' \
+# RUN: --xfail-not '*' \
+# RUN: %{inputs}/xfail-cl \
+# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
+
# RUN: env LIT_XFAIL='false.txt;false2.txt;top-level-suite :: b :: test.txt' \
# RUN: LIT_XFAIL_NOT='true-xfail.txt;top-level-suite :: a :: test-xfail.txt' \
# RUN: %{lit} %{inputs}/xfail-cl \
# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
+# RUN: env LIT_XFAIL='false.txt;false2.txt;top-level-suite :: b :: test.txt' \
+# RUN: LIT_XFAIL_NOT='*' \
+# RUN: %{lit} %{inputs}/xfail-cl \
+# RUN: | FileCheck --check-prefix=CHECK-FILTER %s
+
# Check that --xfail-not and LIT_XFAIL_NOT always have precedence.
# RUN: env LIT_XFAIL=true-xfail.txt \
|
1b25068 to
5af21ad
Compare
5af21ad to
b618d13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems reasonable to have a way to tell lit you do not care if expected fails become passes, but I'm not sure about this syntax, as noted in my inline comments. Whatever it ends up being, documentation needs to be updated.
b618d13 to
20d1c63
Compare
|
ack, I'll update the documentation once we settle on the rest here (because the doc would be 90% that 😄 ) |
I mischaracterized it. It says you expect that expected fails have become passes. |
20d1c63 to
2d429b3
Compare
2d429b3 to
2b67338
Compare
So there are no XFAIL tests that are failing because of a non-zero exit status of a command (e.g., opt, diff, grep)? That is, simply avoiding FileCheck invocations is enough to make all XFAIL tests start to pass? If not, then |
IIUC you're saying it's possible that when turning |
Right. Regardless of profcheck, tests that are already marked XFAIL might be failing places other than FileCheck, so
For profcheck, is it really worthwhile to run tests that are currently expected to fail? Maybe a more complete solution than |
2b67338 to
d400000
Compare
|
Makes sense, ptal. |
|
(I realize I need to update documentation and commit message, but wanted first to get agreement on the implementation bit) |
|
✅ With the latest revision this PR passed the Python code formatter. |
d400000 to
5a76e04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
5a76e04 to
776e999
Compare
llvm/utils/lit/tests/xfail-cl.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have an XFAIL: foo case where foo is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like a Inputs/false-xfail.txt (same as true-xfail.txt but RUN: false)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I mean a test with, e.g., XFAIL: a-missing-feature. Because a-missing-feature is intentionally a missing feature for the current platform, you don't have to declare it anywhere. In other words, test the issue that originally motivated calling isExpectedToFail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, ptal
776e999 to
9a797be
Compare
9a797be to
e97f67f
Compare

See the related issue. We want to set up a build bot where
optruns with-enable-profcheck, which insertsMD_profbefore running the rest of the pipeline requested fromopt, and then validates resulting profile information (more info in the RFC linked by the aforementioned issue)In that setup, we will also ignore
FileCheck: while the profile info inserted is, currently, equivalent to the profile info a pass would observe viaBranchProbabilityInfo/BlockFrequencyInfo, (1) we may want to change that, and (2) some tests are quite sensitive to the output IR, and break if, for instance, extra metadata is present (which it would be due to-enable-profcheck). Since we're just interested in profile consistency on the upcoming bot, ignoringFileCheckis simpler and sufficient. However, this has the effect of passing XFAIL tests. Rather than listing them all, the alternative is to just exclude XFAIL tests.This PR adds support for that by introducing a
--exclude-xfailoption tollvm-lit.Issue #147390