Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add expected behavior to fail with replicates that have the same name #161

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions workflows/tests/bugs/replicates_same_filename/main.nf.test
Original file line number Diff line number Diff line change
@@ -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()
}
)
}
}
}
18 changes: 18 additions & 0 deletions workflows/tests/bugs/replicates_same_filename/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -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,
3 changes: 3 additions & 0 deletions workflows/tests/bugs/replicates_same_filename/same_id.csv
Original file line number Diff line number Diff line change
@@ -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,
Loading