diff --git a/workflows/tests/bugs/replicates_same_filename/main.nf.test b/workflows/tests/bugs/replicates_same_filename/main.nf.test new file mode 100644 index 00000000..0664c3a6 --- /dev/null +++ b/workflows/tests/bugs/replicates_same_filename/main.nf.test @@ -0,0 +1,45 @@ +nextflow_pipeline { + + name "Replicates" + script "../../../../main.nf" + tag "bug" + + // BUG https://github.com/nf-core/nascent/issues/159 + test("Should fail with replicates that have the same filename") { + when { + params { + outdir = "$outputDir" + input = "${projectDir}/workflows/tests/bugs/replicates_same_filename/replicates_same_filename.csv" + } + } + + then { + // FIXME this fails at FASTQC but should fail at nf-validation + // Might get fixed in nf-schema? + assert workflow.failed + assert snapshot( + workflow.trace.tasks().size(), + ).match() + } + } + + // BUG https://github.com/nf-core/nascent/issues/159 + test("Should work with replicates that have the same id and different file names") { + when { + params { + outdir = "$outputDir" + input = "${projectDir}/workflows/tests/bugs/replicates_same_filename/same_id.csv" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.trace.tasks().size(), + ).match() + } + ) + } + } +} diff --git a/workflows/tests/bugs/replicates_same_filename/main.nf.test.snap b/workflows/tests/bugs/replicates_same_filename/main.nf.test.snap new file mode 100644 index 00000000..ff74c64f --- /dev/null +++ b/workflows/tests/bugs/replicates_same_filename/main.nf.test.snap @@ -0,0 +1,18 @@ +{ + "Should fail with replicates that have the same filename": { + "content": [0], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-22T12:24:05.004711151" + }, + "Should work with replicates that have the same id and different file names": { + "content": [31], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-22T14:52:05.603228732" + } +} diff --git a/workflows/tests/bugs/replicates_same_filename/replicates_same_filename.csv b/workflows/tests/bugs/replicates_same_filename/replicates_same_filename.csv new file mode 100644 index 00000000..ab3ae47e --- /dev/null +++ b/workflows/tests/bugs/replicates_same_filename/replicates_same_filename.csv @@ -0,0 +1,3 @@ +sample,fastq_1,fastq_2 +SAMPLE_REP1,https://raw.githubusercontent.com/nf-core/test-datasets/nascent/testdata/SRX882903_T3.fastq.gz, +SAMPLE_REP1,https://github.com/nf-core/test-datasets/raw/nascent/testdata/SRX882903_T3.fastq.gz, diff --git a/workflows/tests/bugs/replicates_same_filename/same_id.csv b/workflows/tests/bugs/replicates_same_filename/same_id.csv new file mode 100644 index 00000000..bc7eaecf --- /dev/null +++ b/workflows/tests/bugs/replicates_same_filename/same_id.csv @@ -0,0 +1,3 @@ +sample,fastq_1,fastq_2 +SAMPLE_REP1,https://raw.githubusercontent.com/nf-core/test-datasets/nascent/testdata/SRX882903_T1.fastq.gz, +SAMPLE_REP1,https://raw.githubusercontent.com/nf-core/test-datasets/nascent/testdata/SRX882903_T2.fastq.gz,