[llvm] [Util] Only run --update-tests functions on failing tests (PR #155148)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 24 01:30:21 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r HEAD~1...HEAD llvm/utils/lit/tests/Inputs/pass-test-update/should_not_run.py llvm/utils/lit/tests/pass-test-update.py llvm/utils/lit/lit/TestRunner.py llvm/utils/lit/lit/worker.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- lit/TestRunner.py	2025-08-24 08:23:59.000000 +0000
+++ lit/TestRunner.py	2025-08-24 08:29:51.115587 +0000
@@ -1201,11 +1201,12 @@
         if litConfig.maxIndividualTestTime > 0 and result.timeoutReached:
             out += "# error: command reached timeout: %s\n" % (
                 str(result.timeoutReached),
             )
 
-        if (litConfig.update_tests
+        if (
+            litConfig.update_tests
             and result.exitCode != 0
             and not timeoutInfo
             # Don't run test updaters on XPASS failures -
             # they are not expected to be able to fix them
             and not test.isExpectedToFail()
--- tests/Inputs/pass-test-update/should_not_run.py	2025-08-24 08:23:59.000000 +0000
+++ tests/Inputs/pass-test-update/should_not_run.py	2025-08-24 08:29:51.183489 +0000
@@ -1,3 +1,2 @@
 def should_not_run(foo, bar):
     raise Exception("this test updater should only run on failure")
-
--- tests/pass-test-update.py	2025-08-24 08:23:59.000000 +0000
+++ tests/pass-test-update.py	2025-08-24 08:29:51.190584 +0000
@@ -35,6 +35,5 @@
 # CHECK-NEXT: # `-----------------------------
 # CHECK-EMPTY:
 # CHECK-NEXT: --
 # CHECK-EMPTY:
 # CHECK-NEXT: ********************
-

``````````

</details>


https://github.com/llvm/llvm-project/pull/155148


More information about the llvm-commits mailing list