@@ -287,7 +287,7 @@ def setup_logging(self, log_to_file=False):
287
287
288
288
@property
289
289
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 " )
291
291
292
292
@property
293
293
def emulator_log_path (self ) -> Path :
@@ -401,6 +401,7 @@ def start_ffx_isolation(self):
401
401
# Set configs
402
402
configs = {
403
403
"log.enabled" : "true" ,
404
+ "log.dir" : self .tmp_dir (),
404
405
"test.is_isolated" : "true" ,
405
406
"test.experimental_structured_output" : "true" ,
406
407
}
@@ -575,43 +576,19 @@ def start(self):
575
576
stderr_handler = self .subprocess_logger .debug ,
576
577
)
577
578
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
- )
607
579
check_call_with_logging (
608
580
[
609
581
ffx_path ,
610
582
"repository" ,
611
583
"server" ,
612
584
"start" ,
585
+ "--background" ,
613
586
"--address" ,
614
587
"[::]:0" ,
588
+ "--repo-path" ,
589
+ self .repo_dir (),
590
+ "--repository" ,
591
+ self .TEST_REPO_NAME
615
592
],
616
593
env = ffx_env ,
617
594
stdout_handler = self .subprocess_logger .debug ,
@@ -1009,6 +986,21 @@ def stop(self):
1009
986
stderr_handler = self .subprocess_logger .debug ,
1010
987
)
1011
988
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
+
1012
1004
# Stop ffx isolation
1013
1005
self .env_logger .info ("Stopping ffx isolation..." )
1014
1006
self .stop_ffx_isolation ()
0 commit comments