Skip to content

Commit 56a5b7e

Browse files
Rollup merge of #112664 - djkoloski:fuchsia_test_runner_tmpdir, r=tmandry
Add support for test tmpdir to fuchsia test runner Also format the script to keep the code nice. This fixes the `tests/ui/std/switch-stdout.rs` test on Fuchsia. r? `@tmandry`
2 parents b36ddee + 71db999 commit 56a5b7e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ci/docker/scripts/fuchsia-test-runner.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def ffx_isolate_dir(self):
171171
def home_dir(self):
172172
return os.path.join(self.tmp_dir(), "user-home")
173173

174-
175174
def start_ffx_isolation(self):
176175
# Most of this is translated directly from ffx's isolate library
177176
os.mkdir(self.ffx_isolate_dir())
@@ -424,7 +423,7 @@ def start(self):
424423
)
425424

426425
# Create lockfiles
427-
open(self.pm_lockfile_path(), 'a').close()
426+
open(self.pm_lockfile_path(), "a").close()
428427

429428
# Write to file
430429
self.write_to_file()
@@ -458,6 +457,7 @@ def start(self):
458457
],
459458
use: [
460459
{{ storage: "data", path: "/data" }},
460+
{{ storage: "tmp", path: "/tmp" }},
461461
{{ protocol: [ "fuchsia.process.Launcher" ] }},
462462
{{ protocol: [ "fuchsia.posix.socket.Provider" ] }}
463463
],
@@ -571,6 +571,9 @@ def log(msg):
571571
if os.getenv("RUST_BACKTRACE") == None:
572572
env_vars += f'\n "RUST_BACKTRACE=0",'
573573

574+
# Use /tmp as the test temporary directory
575+
env_vars += f'\n "RUST_TEST_TMPDIR=/tmp",'
576+
574577
cml.write(
575578
self.CML_TEMPLATE.format(env_vars=env_vars, exe_name=exe_name)
576579
)
@@ -642,7 +645,7 @@ def log(msg):
642645
log("Publishing package to repo...")
643646

644647
# Publish package to repo
645-
with open(self.pm_lockfile_path(), 'w') as pm_lockfile:
648+
with open(self.pm_lockfile_path(), "w") as pm_lockfile:
646649
fcntl.lockf(pm_lockfile.fileno(), fcntl.LOCK_EX)
647650
subprocess.check_call(
648651
[
@@ -1045,9 +1048,7 @@ def print_help(args):
10451048
)
10461049
debug_parser.set_defaults(func=debug)
10471050

1048-
syslog_parser = subparsers.add_parser(
1049-
"syslog", help="prints the device syslog"
1050-
)
1051+
syslog_parser = subparsers.add_parser("syslog", help="prints the device syslog")
10511052
syslog_parser.set_defaults(func=syslog)
10521053

10531054
args = parser.parse_args()

0 commit comments

Comments
 (0)