@@ -22,6 +22,7 @@ use tracedecay::storage::{
2222 profile_sharded_layout, read_enrollment_marker, write_enrollment_marker,
2323 write_repository_identity_marker, write_store_manifest,
2424} ;
25+ use tracedecay:: tracedecay:: { TraceDecay , TraceDecayOpenOptions } ;
2526
2627fn canonical_temp_path ( path : & Path ) -> PathBuf {
2728 path. canonicalize ( ) . unwrap_or_else ( |_| path. to_path_buf ( ) )
@@ -101,16 +102,20 @@ fn add_tracedecay_path_shim(command: &mut Command, home: &Path) -> PathBuf {
101102/// not the behaviour under test.
102103fn init_project_in_process ( home : & Path , project : & Path ) {
103104 let project = canonical_temp_path ( project) ;
104- let output = tracedecay_command ( home, & project)
105- . arg ( "init" )
106- . output ( )
105+ let profile_root = profile_root ( home) ;
106+ create_runtime ( ) . block_on ( async {
107+ let cg = TraceDecay :: init_with_options (
108+ & project,
109+ TraceDecayOpenOptions {
110+ global_db_path : Some ( profile_root. join ( "global.db" ) ) ,
111+ profile_root : Some ( profile_root) ,
112+ } ,
113+ )
114+ . await
107115 . expect ( "fixture init should run" ) ;
108- assert ! (
109- output. status. success( ) ,
110- "fixture init failed\n stdout:\n {}\n stderr:\n {}" ,
111- String :: from_utf8_lossy( & output. stdout) ,
112- String :: from_utf8_lossy( & output. stderr)
113- ) ;
116+ cg. checkpoint ( ) . await . expect ( "fixture checkpoint" ) ;
117+ cg. close ( ) ;
118+ } ) ;
114119}
115120
116121fn git ( project : & Path , args : & [ & str ] ) {
@@ -1591,6 +1596,7 @@ fn branch_add_writes_new_branch_db_into_profile_shard() {
15911596 git ( & project_root, & [ "checkout" , "-b" , "feature/new" ] ) ;
15921597 let project_id = default_profile_project_id ( & project_root) ;
15931598 let shard_root = profile_sharded_data_root ( & profile_root ( home. path ( ) ) , & project_id) ;
1599+ #[ cfg( unix) ]
15941600 let _daemon = crate :: common:: spawn_tracedecay_daemon ( home. path ( ) ) ;
15951601 let mut command = tracedecay_command_without_daemon ( home. path ( ) , & project_root) ;
15961602 command. args ( [ "branch" , "add" , "feature/new" ] ) ;
0 commit comments