Skip to content

Commit

Permalink
Unrolled build for rust-lang#132163
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132163 - claywilkinson:master, r=tmandry

Update Fuchsia CI script for package serving

This updates the "start" and "stop" methods
of the test runner to use the standalone package
server.

r? `@tmandry`
  • Loading branch information
rust-timer authored Oct 26, 2024
2 parents ae4c6b6 + ce4fc99 commit 9e1623c
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions src/ci/docker/scripts/fuchsia-test-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def setup_logging(self, log_to_file=False):

@property
def package_server_log_path(self) -> Path:
return self.tmp_dir().joinpath("package_server_log")
return self.tmp_dir().joinpath(f"repo_{self.TEST_REPO_NAME}.log")

@property
def emulator_log_path(self) -> Path:
Expand Down Expand Up @@ -401,6 +401,7 @@ def start_ffx_isolation(self):
# Set configs
configs = {
"log.enabled": "true",
"log.dir": self.tmp_dir(),
"test.is_isolated": "true",
"test.experimental_structured_output": "true",
}
Expand Down Expand Up @@ -575,43 +576,19 @@ def start(self):
stderr_handler=self.subprocess_logger.debug,
)

# Add repository
check_call_with_logging(
[
ffx_path,
"repository",
"add-from-pm",
"--repository",
self.TEST_REPO_NAME,
self.repo_dir(),
],
env=ffx_env,
stdout_handler=self.subprocess_logger.debug,
stderr_handler=self.subprocess_logger.debug,
)

# Start repository server
# Note that we must first enable the repository server daemon.
check_call_with_logging(
[
ffx_path,
"config",
"set",
"repository.server.enabled",
"true",
],
env=ffx_env,
stdout_handler=self.subprocess_logger.debug,
stderr_handler=self.subprocess_logger.debug,
)
check_call_with_logging(
[
ffx_path,
"repository",
"server",
"start",
"--background",
"--address",
"[::]:0",
"--repo-path",
self.repo_dir(),
"--repository",
self.TEST_REPO_NAME
],
env=ffx_env,
stdout_handler=self.subprocess_logger.debug,
Expand Down Expand Up @@ -1009,6 +986,21 @@ def stop(self):
stderr_handler=self.subprocess_logger.debug,
)

# Stop the package server
self.env_logger.info("Stopping package server...")
check_call_with_logging(
[
self.tool_path("ffx"),
"repository",
"server",
"stop",
self.TEST_REPO_NAME
],
env=self.ffx_cmd_env(),
stdout_handler=self.subprocess_logger.debug,
stderr_handler=self.subprocess_logger.debug,
)

# Stop ffx isolation
self.env_logger.info("Stopping ffx isolation...")
self.stop_ffx_isolation()
Expand Down

0 comments on commit 9e1623c

Please sign in to comment.