File tree 1 file changed +34
-1
lines changed 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,40 @@ def get_executor(self) -> str:
18
18
19
19
def get_executor_settings (self ) -> Optional [ExecutorSettingsBase ]:
20
20
return ExecutorSettings (init_seconds_before_status_checks = 1 )
21
+
22
+ class TestEfficiencyReport (snakemake .common .tests .TestWorkflowsLocalStorageBase ):
23
+ __test__ = True
24
+
25
+ def get_executor (self ) -> str :
26
+ return "slurm"
27
+
28
+ def get_executor_settings (self ) -> Optional [ExecutorSettingsBase ]:
29
+ return ExecutorSettings (efficiency_report = True ,
30
+ init_seconds_before_status_checks = 1 )
31
+
32
+ def test_efficiency_report_generation (self ):
33
+ # 1. Define a simple workflow (e.g., in a temporary file)
34
+ workflow_content = """
35
+ rule all:
36
+ input:
37
+ "output.txt"
38
+
39
+ rule dummy_rule:
40
+ output:
41
+ "output.txt"
42
+ shell:
43
+ "touch output.txt"
44
+ """
45
+ with open ("Snakefile" , "w" ) as f :
46
+ f .write (workflow_content )
47
+
48
+ # 2. Run the workflow
49
+ self .run_snakemake ()
50
+
51
+ # 3. Verify the report file exists
52
+ report_filename = f"efficiency_report_{ self .run_uuid } .log"
53
+ report_path = os .path .join (self .slurm_logdir , report_filename )
54
+ self .assertTrue (os .path .exists (report_path ), f"Report file { report_path } not found." )
21
55
22
56
23
57
class TestWorkflowsRequeue (TestWorkflows ):
@@ -251,7 +285,6 @@ def test_gpu_model_nested_string_raise(self, mock_job):
251
285
):
252
286
set_gres_string (job )
253
287
254
-
255
288
class TestSLURMResources (TestWorkflows ):
256
289
"""
257
290
Test workflows using job resources passed as part of the job configuration.
You can’t perform that action at this time.
0 commit comments