Skip to content

Commit bc8e8c2

Browse files
committed
Fixed test error
1 parent 39a2e8a commit bc8e8c2

3 files changed

Lines changed: 164 additions & 160 deletions

File tree

tests/NovaSeq6000.main_subsample.nf.test

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,14 @@ nextflow_pipeline {
3838
)
3939
}
4040
}
41+
4142
test("NovaSeq6000 data test relative sample size") {
42-
config """
43-
process {
44-
sample_size = 0.9
45-
}
46-
"""
43+
4744
when {
4845
config "./NovaSeq6000.main_subsample.nf.test.config"
4946
params {
5047
outdir = "$outputDir"
48+
sample_size = 0.9
5149
}
5250
}
5351

@@ -75,26 +73,29 @@ nextflow_pipeline {
7573
)
7674
}
7775
}
78-
test("NovaSeq6000 data test sample size exceeds") {
79-
config """
80-
process {
81-
sample_size = 120
82-
}
83-
"""
76+
test("NovaSeq6000 data test sample size exceeds available reads") {
77+
8478
when {
8579
config "./NovaSeq6000.main_subsample.nf.test.config"
8680
params {
8781
outdir = "$outputDir"
82+
sample_size = 120
8883
}
8984
}
9085

9186
then {
92-
def log_path = "./.nextflow.log"
93-
assert path(log_path).text.contains("Warning: Requested sample_size (120) is larger than available reads in Undetermined_5 (100). Pipeline will continue with 100 reads.")
94-
assert path(log_path).text.contains("Warning: Requested sample_size (120) is larger than available reads in SampleA_2 (100). Pipeline will continue with 100 reads.")
95-
assert path(log_path).text.contains("Warning: Requested sample_size (120) is larger than available reads in sampletest_4 (100). Pipeline will continue with 100 reads.")
96-
assert path(log_path).text.contains("Warning: Requested sample_size (120) is larger than available reads in Sample23_3 (100). Pipeline will continue with 100 reads.")
97-
assert path(log_path).text.contains("Warning: Requested sample_size (120) is larger than available reads in Sample1_1 (100). Pipeline will continue with 100 reads.")
87+
def warn_messages = [
88+
"Warning: Requested sample_size (120) is larger than available reads in Undetermined_5 (100). Pipeline will continue with 100 reads.",
89+
"Warning: Requested sample_size (120) is larger than available reads in SampleA_2 (100). Pipeline will continue with 100 reads.",
90+
"Warning: Requested sample_size (120) is larger than available reads in sampletest_4 (100). Pipeline will continue with 100 reads.",
91+
"Warning: Requested sample_size (120) is larger than available reads in Sample23_3 (100). Pipeline will continue with 100 reads.",
92+
"Warning: Requested sample_size (120) is larger than available reads in Sample1_1 (100). Pipeline will continue with 100 reads."
93+
]
94+
assert workflow.success
95+
for ( msg in warn_messages ) {
96+
// Read warning from stdout as nf-test does not capture log messages
97+
assert workflow.stdout.contains(msg)
98+
}
9899
}
99100
}
100101
}

0 commit comments

Comments
 (0)