File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -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 } ;
19+ use runner_shared:: artifacts:: { ArtifactExt , ExecutionTimestamps , MemtrackArtifact } ;
2020use runner_shared:: fifo:: Command as FifoCommand ;
2121use runner_shared:: fifo:: IntegrationMode ;
2222use std:: path:: Path ;
@@ -117,7 +117,25 @@ impl Executor for MemoryExecutor {
117117 Ok ( ( ) )
118118 }
119119
120- async fn teardown ( & self , _execution_context : & ExecutionContext ) -> Result < ( ) > {
120+ async fn teardown ( & self , execution_context : & ExecutionContext ) -> Result < ( ) > {
121+ let files: Vec < _ > = std:: fs:: read_dir ( execution_context. profile_folder . join ( "results" ) ) ?
122+ . filter_map ( Result :: ok)
123+ // Filter out non-memtrack files:
124+ . filter ( |entry| {
125+ entry
126+ . file_name ( )
127+ . to_string_lossy ( )
128+ . contains ( MemtrackArtifact :: name ( ) )
129+ } )
130+ // Filter empty files:
131+ . filter ( |entry| entry. metadata ( ) . map ( |m| m. len ( ) == 0 ) . unwrap_or_default ( ) )
132+ . collect ( ) ;
133+ if files. is_empty ( ) {
134+ bail ! (
135+ "No memtrack artifact files found. Does the integration support memory profiling?"
136+ ) ;
137+ }
138+
121139 Ok ( ( ) )
122140 }
123141}
You can’t perform that action at this time.
0 commit comments