@@ -287,7 +287,7 @@ def setup_logging(self, log_to_file=False):
287287
288288 @property
289289 def package_server_log_path (self ) -> Path :
290- return self .tmp_dir ().joinpath ("package_server_log " )
290+ return self .tmp_dir ().joinpath (f"repo_ { self . TEST_REPO_NAME } .log " )
291291
292292 @property
293293 def emulator_log_path (self ) -> Path :
@@ -401,6 +401,7 @@ def start_ffx_isolation(self):
401401 # Set configs
402402 configs = {
403403 "log.enabled" : "true" ,
404+ "log.dir" : self .tmp_dir (),
404405 "test.is_isolated" : "true" ,
405406 "test.experimental_structured_output" : "true" ,
406407 }
@@ -575,43 +576,19 @@ def start(self):
575576 stderr_handler = self .subprocess_logger .debug ,
576577 )
577578
578- # Add repository
579- check_call_with_logging (
580- [
581- ffx_path ,
582- "repository" ,
583- "add-from-pm" ,
584- "--repository" ,
585- self .TEST_REPO_NAME ,
586- self .repo_dir (),
587- ],
588- env = ffx_env ,
589- stdout_handler = self .subprocess_logger .debug ,
590- stderr_handler = self .subprocess_logger .debug ,
591- )
592-
593- # Start repository server
594- # Note that we must first enable the repository server daemon.
595- check_call_with_logging (
596- [
597- ffx_path ,
598- "config" ,
599- "set" ,
600- "repository.server.enabled" ,
601- "true" ,
602- ],
603- env = ffx_env ,
604- stdout_handler = self .subprocess_logger .debug ,
605- stderr_handler = self .subprocess_logger .debug ,
606- )
607579 check_call_with_logging (
608580 [
609581 ffx_path ,
610582 "repository" ,
611583 "server" ,
612584 "start" ,
585+ "--background" ,
613586 "--address" ,
614587 "[::]:0" ,
588+ "--repo-path" ,
589+ self .repo_dir (),
590+ "--repository" ,
591+ self .TEST_REPO_NAME
615592 ],
616593 env = ffx_env ,
617594 stdout_handler = self .subprocess_logger .debug ,
@@ -1009,6 +986,21 @@ def stop(self):
1009986 stderr_handler = self .subprocess_logger .debug ,
1010987 )
1011988
989+ # Stop the package server
990+ self .env_logger .info ("Stopping package server..." )
991+ check_call_with_logging (
992+ [
993+ self .tool_path ("ffx" ),
994+ "repository" ,
995+ "server" ,
996+ "stop" ,
997+ self .TEST_REPO_NAME
998+ ],
999+ env = self .ffx_cmd_env (),
1000+ stdout_handler = self .subprocess_logger .debug ,
1001+ stderr_handler = self .subprocess_logger .debug ,
1002+ )
1003+
10121004 # Stop ffx isolation
10131005 self .env_logger .info ("Stopping ffx isolation..." )
10141006 self .stop_ffx_isolation ()
0 commit comments