|
| 1 | +def INPUT_PATH = new File('workflows/nf_aggregate/assets/test_benchmark.csv').canonicalPath |
| 2 | + |
| 3 | +def expectedOutputNames = [ |
| 4 | + 'benchmark_report', |
| 5 | + 'benchmark_report/benchmark.duckdb', |
| 6 | + 'benchmark_report/benchmark_report.html', |
| 7 | + 'pipeline_info', |
| 8 | + 'pipeline_info/collated_software_versions.yml', |
| 9 | +] |
| 10 | + |
| 11 | +def collatedVersions = { outdir -> |
| 12 | + new File("${outdir}/pipeline_info/collated_software_versions.yml").text |
| 13 | +} |
| 14 | + |
| 15 | +nextflow_pipeline { |
| 16 | + name "Pipeline benchmark from tarballs" |
| 17 | + script "../../main.nf" |
| 18 | + tag "pipeline" |
| 19 | + tag "nf-aggregate" |
| 20 | + tag "benchmark-tarball" |
| 21 | + |
| 22 | + test("benchmark report includes extracted tarball runs") { |
| 23 | + tag("benchmark") |
| 24 | + |
| 25 | + when { |
| 26 | + params { |
| 27 | + input = INPUT_PATH |
| 28 | + outdir = "$outputDir" |
| 29 | + generate_benchmark_report = true |
| 30 | + } |
| 31 | + } |
| 32 | + |
| 33 | + then { |
| 34 | + def versions = collatedVersions(params.outdir) |
| 35 | + def stdout = workflow.stdout.join('\n') |
| 36 | + def report = new File("${params.outdir}/benchmark_report/benchmark_report.html") |
| 37 | + def database = new File("${params.outdir}/benchmark_report/benchmark.duckdb") |
| 38 | + def reportText = report.text |
| 39 | + |
| 40 | + assert workflow.success |
| 41 | + assert workflow.trace.succeeded().size() == 3 |
| 42 | + assert !stdout.contains('Invalid method invocation') |
| 43 | + assert stdout.contains('SEQERALABS_NF_AGGREGATE:NF_AGGREGATE:EXTRACT_TARBALL') |
| 44 | + assert stdout.contains('SEQERALABS_NF_AGGREGATE:NF_AGGREGATE:BENCHMARK_REPORT') |
| 45 | + assert versions.contains('EXTRACT_TARBALL:') |
| 46 | + assert versions.contains('BENCHMARK_REPORT:') |
| 47 | + assert report.isFile() |
| 48 | + assert database.isFile() |
| 49 | + assert reportText.contains('Benchmark overview') |
| 50 | + assert reportText.contains('Run overview') |
| 51 | + assert reportText.contains('Process overview') |
| 52 | + assert reportText.contains('Task overview') |
| 53 | + assert reportText.contains('15dvxY1LnZYrYe') |
| 54 | + assert reportText.contains('5ymDk0hmgqv4L4') |
| 55 | + assert reportText.contains('g5') |
| 56 | + assert reportText.contains('cpu') |
| 57 | + |
| 58 | + assert snapshot( |
| 59 | + workflow.trace.succeeded().size(), |
| 60 | + removeFromYamlMap("$outputDir/pipeline_info/collated_software_versions.yml", "Workflow"), |
| 61 | + expectedOutputNames |
| 62 | + ).match() |
| 63 | + } |
| 64 | + } |
| 65 | +} |
0 commit comments