[llvm] [llvm] Add support for running tests as root (PR #75285)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 22:30:11 PST 2023


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 f2afd10776bda7e0dc23176afd1a99d4ccbf967c...8bd6226f19ad50d7930b45533b6d2c60cb809f9a llvm/utils/lit/lit/llvm/config.py
``````````

</details>

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

``````````diff
--- config.py	2023-12-13 06:25:26.000000 +0000
+++ config.py	2023-12-13 06:30:03.139037 +0000
@@ -11,15 +11,16 @@
 from lit.llvm.subst import FindTool
 from lit.llvm.subst import ToolSubst
 
 lit_path_displayed = False
 
+
 def user_is_root():
     # getpass.getuser() can throw an exception in some cases:
     # See https://github.com/python/cpython/issues/76912
     try:
-        if getpass.getuser() == 'root':
+        if getpass.getuser() == "root":
             return True
     except:
         pass
 
     return False
@@ -165,11 +166,11 @@
                 features.add("target-arm")
             if re.match(r'^ppc64le.*-linux', target_triple):
                 features.add('target=powerpc64le-linux')
 
         if not user_is_root():
-            features.add('non-root-user')
+            features.add("non-root-user")
 
         use_gmalloc = lit_config.params.get("use_gmalloc", None)
         if lit.util.pythonize_bool(use_gmalloc):
             # Allow use of an explicit path for gmalloc library.
             # Will default to '/usr/lib/libgmalloc.dylib' if not set.

``````````

</details>


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


More information about the llvm-commits mailing list