diff --git a/modules/local/benchmark_report/main.nf b/modules/local/benchmark_report/main.nf index 42db33b..5e1a59b 100644 --- a/modules/local/benchmark_report/main.nf +++ b/modules/local/benchmark_report/main.nf @@ -6,6 +6,7 @@ process BENCHMARK_REPORT { path run_dumps val groups path benchmark_aws_cur_report + val remove_failed_tasks output: path "benchmark_report.html" , emit: benchmark_html @@ -14,6 +15,8 @@ process BENCHMARK_REPORT { script: def aws_cost_param = benchmark_aws_cur_report ? "--profile cost -P aws_cost:\$TASK_DIR/${benchmark_aws_cur_report}" : "" def benchmark_samplesheet = "benchmark_samplesheet.csv" + def failed_tasks = remove_failed_tasks ? "-P remove_failed_tasks:True" : "" + """ # Set up R environment from renv export R_LIBS_USER=/project/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu @@ -33,6 +36,7 @@ process BENCHMARK_REPORT { quarto render main_benchmark_report.qmd \\ -P log_csv:"\$TASK_DIR/"${benchmark_samplesheet} \\ $aws_cost_param \\ + $failed_tasks \\ --output-dir .\\ --output benchmark_report.html diff --git a/modules/local/benchmark_report/tests/main.nf.test b/modules/local/benchmark_report/tests/main.nf.test new file mode 100644 index 0000000..109f478 --- /dev/null +++ b/modules/local/benchmark_report/tests/main.nf.test @@ -0,0 +1,41 @@ +nextflow_process { + name "Test Process BENCHMARK_REPORT" + script "../main.nf" + process "BENCHMARK_REPORT" + + setup { + run("SEQERA_RUNS_DUMP") { + script "../../seqera_runs_dump/main.nf" + process { + """ + input[0] = ['id': 'fjV0o6yPbbamB', 'workspace': 'community/showcase', 'group': 'group1'] + input[1] = "https://api.tower.nf" + input[2] = "" + input[3] = "" + """ + } + } + } + + test("Should run with removing failed tasks") { + when { + params { + outdir = "tests/results" + } + process { + """ + input[0] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]} + input[1] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group} + input[2] = [] + input[3] = true + """ + } + } + + then { + assert process.success + assert path(process.out.benchmark_html.get(0)).exists() + assert path(process.out.versions.get(0)).exists() + } + } +} diff --git a/modules/local/seqera_runs_dump/tests/main.nf.test.snap b/modules/local/seqera_runs_dump/tests/main.nf.test.snap index af0fe79..fd9450a 100644 --- a/modules/local/seqera_runs_dump/tests/main.nf.test.snap +++ b/modules/local/seqera_runs_dump/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "Should run without failures": { "content": [ [ - "service-info.json:md5,75a5b8cded8f0ce9aab2125c0ee89f63", + "service-info.json:md5,5738071394871f50948ae77090d4af50", "workflow-load.json:md5,4f02d5a24ab89aa648cd4346785c8f2c", "workflow-metadata.json:md5,b37b4faeddf283a2c44cbe4000e4ab6e", "workflow-metrics.json:md5,13a5b5d7447fad4a8baa053d1abf85e5", @@ -13,8 +13,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "23.10.1" + "nextflow": "25.01.0" }, - "timestamp": "2024-11-11T11:53:03.835699" + "timestamp": "2025-02-21T15:07:19.112104" } -} +} \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index 178d2a2..ea42206 100644 --- a/nextflow.config +++ b/nextflow.config @@ -28,8 +28,9 @@ params { skip_multiqc = false // Benchmark report options - generate_benchmark_report = false + generate_benchmark_report = false benchmark_aws_cur_report = null + remove_failed_tasks = true // Boilerplate options outdir = 'results' diff --git a/nextflow_schema.json b/nextflow_schema.json index cd41a13..3ddbb64 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -80,6 +80,11 @@ "description": "AWS CUR report from data exports.", "pattern": "^\\S+\\.parquet", "format": "file-path" + }, + "remove_failed_tasks": { + "type": "boolean", + "fa_icon": "fas fa-times-circle", + "description": "Remove failed tasks from the benchmark report." } }, "required": ["seqera_api_endpoint"] diff --git a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap index 41e25e3..dd52c0d 100644 --- a/subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap +++ b/subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap @@ -3,22 +3,37 @@ "content": [ [ { + "group": [ + + ], "id": "2lXd1j7OwZVfxh", "workspace": "community/showcase" }, { + "group": [ + + ], "id": "38QXz4OfQDpwOV", "workspace": "community/showcase" }, { + "group": [ + + ], "id": "3iFMo0NtH1Byvy", "workspace": "community/showcase" }, { + "group": [ + + ], "id": "4Bi5xBK6E2Nbhj", "workspace": "community/showcase" }, { + "group": [ + + ], "id": "4LWT4uaXDaGcDY", "workspace": "community/showcase" } @@ -26,8 +41,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.04.2" + "nextflow": "25.01.0" }, - "timestamp": "2024-11-11T11:32:52.476285" + "timestamp": "2025-02-26T16:10:24.54507716" } } \ No newline at end of file diff --git a/workflows/nf_aggregate/main.nf b/workflows/nf_aggregate/main.nf index f0da299..5c955f4 100644 --- a/workflows/nf_aggregate/main.nf +++ b/workflows/nf_aggregate/main.nf @@ -66,9 +66,10 @@ workflow NF_AGGREGATE { BENCHMARK_REPORT ( SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]}, SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group}, - aws_cur_report + aws_cur_report, + params.remove_failed_tasks ) - ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions.first()) + ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions) } //