@@ -37,13 +37,19 @@ impl IsolatedEmulator {
37
37
pub async fn start ( name : & str ) -> anyhow:: Result < Self > {
38
38
let amber_files_path = std:: env:: var ( "PACKAGE_REPOSITORY_PATH" )
39
39
. expect ( "PACKAGE_REPOSITORY_PATH env var must be set -- run this test with 'fx test'" ) ;
40
- Self :: start_internal ( name, Some ( & amber_files_path) ) . await
40
+ let symbol_index_path = std:: env:: var ( "SYMBOL_INDEX_PATH" )
41
+ . expect ( "SYMBOL_INDEX_PATH env var must be set -- run this test with 'fx test'" ) ;
42
+ Self :: start_internal ( name, Some ( & amber_files_path) , Some ( & symbol_index_path) ) . await
41
43
}
42
44
43
45
// This is private to be used for testing with a path to a different package repo. Path
44
46
// to amber-files is optional for testing to ensure that other successful tests are actually
45
47
// matching a developer workflow.
46
- async fn start_internal ( name : & str , amber_files_path : Option < & str > ) -> anyhow:: Result < Self > {
48
+ async fn start_internal (
49
+ name : & str ,
50
+ amber_files_path : Option < & str > ,
51
+ symbol_index_path : Option < & str > ,
52
+ ) -> anyhow:: Result < Self > {
47
53
let emu_name = format ! ( "{name}-emu" ) ;
48
54
49
55
info ! ( %name, "making ffx isolate" ) ;
@@ -90,6 +96,11 @@ impl IsolatedEmulator {
90
96
this. ffx ( & [ "config" , "set" , "log.level" , "debug" ] )
91
97
. await
92
98
. context ( "setting ffx log level" ) ?;
99
+ if let Some ( symbol_index_path) = symbol_index_path {
100
+ this. ffx ( & [ "debug" , "symbol-index" , "add" , symbol_index_path] )
101
+ . await
102
+ . context ( "setting ffx symbol index path" ) ?;
103
+ }
93
104
94
105
this. ffx_isolate . start_daemon ( ) . await ?;
95
106
@@ -385,9 +396,10 @@ mod tests {
385
396
async fn public_apis_succeed ( ) {
386
397
let amber_files_path = std:: env:: var ( "PACKAGE_REPOSITORY_PATH" )
387
398
. expect ( "PACKAGE_REPOSITORY_PATH env var must be set -- run this test with 'fx test'" ) ;
388
- let emu = IsolatedEmulator :: start_internal ( "e2e-emu-public-apis" , Some ( & amber_files_path) )
389
- . await
390
- . expect ( "Couldn't start emulator" ) ;
399
+ let emu =
400
+ IsolatedEmulator :: start_internal ( "e2e-emu-public-apis" , Some ( & amber_files_path) , None )
401
+ . await
402
+ . expect ( "Couldn't start emulator" ) ;
391
403
392
404
info ! ( "Checking target monotonic time to ensure we can connect and get stdout" ) ;
393
405
let time = emu. ffx_output ( & [ "target" , "get-time" ] ) . await . unwrap ( ) ;
@@ -422,9 +434,10 @@ mod tests {
422
434
let test_package_name = std:: env:: var ( "TEST_PACKAGE_NAME" )
423
435
. expect ( "TEST_PACKAGE_NAME env var must be set -- run this test with 'fx test'" ) ;
424
436
let test_package_url = format ! ( "fuchsia-pkg://fuchsia.com/{test_package_name}" ) ;
425
- let emu = IsolatedEmulator :: start_internal ( "pkg-resolve" , Some ( & test_amber_files_path) )
426
- . await
427
- . unwrap ( ) ;
437
+ let emu =
438
+ IsolatedEmulator :: start_internal ( "pkg-resolve" , Some ( & test_amber_files_path) , None )
439
+ . await
440
+ . unwrap ( ) ;
428
441
emu. ssh ( & [ "pkgctl" , "resolve" , & test_package_url] ) . await . unwrap ( ) ;
429
442
emu. stop ( ) . await ;
430
443
}
@@ -433,7 +446,7 @@ mod tests {
433
446
/// demonstrating that the same package is unavailable when there's no server running.
434
447
#[ fuchsia:: test]
435
448
async fn fail_to_resolve_package_when_no_package_server_running ( ) {
436
- let emu = IsolatedEmulator :: start_internal ( "pkg-resolve-fail" , None ) . await . unwrap ( ) ;
449
+ let emu = IsolatedEmulator :: start_internal ( "pkg-resolve-fail" , None , None ) . await . unwrap ( ) ;
437
450
let test_package_name = std:: env:: var ( "TEST_PACKAGE_NAME" )
438
451
. expect ( "TEST_PACKAGE_NAME env var must be set -- run this test with 'fx test'" ) ;
439
452
let test_package_url = format ! ( "fuchsia-pkg://fuchsia.com/{test_package_name}" ) ;
0 commit comments