@@ -16,7 +16,7 @@ use async_trait::async_trait;
1616use ipc_channel:: ipc;
1717use memtrack:: MemtrackIpcClient ;
1818use memtrack:: MemtrackIpcServer ;
19- use runner_shared:: artifacts:: { ArtifactExt , ExecutionTimestamps , MemtrackArtifact } ;
19+ use runner_shared:: artifacts:: { ArtifactExt , ExecutionTimestamps } ;
2020use runner_shared:: fifo:: Command as FifoCommand ;
2121use runner_shared:: fifo:: IntegrationMode ;
2222use semver:: Version ;
@@ -121,28 +121,27 @@ impl Executor for MemoryExecutor {
121121 }
122122
123123 async fn teardown ( & self , execution_context : & ExecutionContext ) -> Result < ( ) > {
124- let files: Vec < _ > = std:: fs:: read_dir ( execution_context. profile_folder . join ( "results" ) ) ?
124+ let results_dir = execution_context. profile_folder . join ( "results" ) ;
125+ let has_benchmarks = std:: fs:: read_dir ( & results_dir) ?
125126 . filter_map ( Result :: ok)
126- // Filter out non-memtrack files:
127+ // Filter out non-ExecutionTimestamps files:
127128 . filter ( |entry| {
128129 entry
129130 . file_name ( )
130131 . to_string_lossy ( )
131- . contains ( MemtrackArtifact :: name ( ) )
132+ . contains ( ExecutionTimestamps :: name ( ) )
132133 } )
133- . flat_map ( |f| std:: fs:: File :: open ( f. path ( ) ) )
134- . filter ( |file| !MemtrackArtifact :: is_empty ( file) )
135- . collect ( ) ;
134+ . filter_map ( |entry| {
135+ let file = std:: fs:: File :: open ( entry. path ( ) ) . ok ( ) ?;
136+ ExecutionTimestamps :: decode_from_reader ( file) . ok ( )
137+ } )
138+ . any ( |artifact| !artifact. uri_by_ts . is_empty ( ) ) ;
136139
137- if files . is_empty ( ) {
140+ if !has_benchmarks {
138141 if !execution_context. config . allow_empty {
139- bail ! (
140- "No memtrack artifact files found. Does the integration support memory profiling?"
141- ) ;
142+ bail ! ( "No memory results found in profile folder: {results_dir:?}." ) ;
142143 } else {
143- info ! (
144- "No memtrack artifact files found. Does the integration support memory profiling?"
145- ) ;
144+ info ! ( "No memory results found in profile folder: {results_dir:?}." ) ;
146145 }
147146 }
148147
0 commit comments