-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[lit] Make a separate tmpdir for every test in the suite #153422
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-testing-tools Author: Aleksei Babushkin (ocelaiwo) ChangesI would like every test in the test suite to have its own temporary directory so that is it easier to track execution artifacts of each test. The suggested change is the simplest one that can be made and it should not break anything since tests should not rely on sharing the temporary directory. We can also make this change configurable so that users can specify desired behavior in their local lit config. Full diff: https://github.com/llvm/llvm-project/pull/153422.diff 1 Files Affected:
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index e7cd70766a3dd..2755bd7154533 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1369,7 +1369,7 @@ def getTempPaths(test):
root, not test source root."""
execpath = test.getExecPath()
execdir, execbase = os.path.split(execpath)
- tmpDir = os.path.join(execdir, "Output")
+ tmpDir = os.path.join(execdir, "Output", f"{execbase}.dir")
tmpBase = os.path.join(tmpDir, execbase)
return tmpDir, tmpBase
|
This feels like a big departure from how the LLVM tests currently work and probably warrants a Discourse thread to discuss it, as I suspect there may be implications that I've not thought of. That being said, I'm not sure I necessarily see the point in changing this. Lit already has a
|
Thank you for the fast reply. I understand your concerns about changing this. The options you described require changing the existing testcases (and thinking about it when writing new ones). Also, if we decide to change the behavior, we can also add timestamps to temporary directories ( |
Most existing tests should already be using one of the two mechanisms I mentioned (and if they aren't, it's a potential test bug), so there should be no need to change them. The LLVM Discourse forum is available at https://discourse.llvm.org/. I'd recommend posting a new thread under the |
I would like every test in the test suite to have its own temporary directory so that is it easier to track execution artifacts of each test. The suggested change is the simplest one that can be made and it should not break anything since tests should not rely on sharing the temporary directory. We can also make this change configurable so that users can specify desired behavior in their local lit config.