From 4a0b14d18627ef719d3454f00539ed6a2a586dfa Mon Sep 17 00:00:00 2001 From: Zhaolong Zhu Date: Mon, 11 Mar 2024 16:53:44 -0700 Subject: [PATCH] run-tests: make temp file under tests directory Summary: our .gitignore only ignores temporary files inside tests directory, so if we run 'run-tests.py' outside of tests directory, we will see some unstracted .test* files. Reviewed By: sggutier Differential Revision: D54749212 fbshipit-source-id: a05d8679ba53188c6cb3d395baade661e7b440ee --- eden/scm/tests/run-tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eden/scm/tests/run-tests.py b/eden/scm/tests/run-tests.py index 020ea3393fdf3..a5ae9ac4da032 100755 --- a/eden/scm/tests/run-tests.py +++ b/eden/scm/tests/run-tests.py @@ -3033,7 +3033,9 @@ def run(self, test): self.stream.write("\n") # Also write the file names to temporary files. So it can be # used in adhoc scripts like `hg revert $(cat .testfailed)`. - with open(".test%s" % title.lower(), "a") as f: + testsdir = os.path.abspath(os.path.dirname(__file__)) + filepath = os.path.join(testsdir, f".test{title.lower()}") + with open(filepath, "a") as f: for name in names: f.write(name + "\n") f.write("\n")