Skip to content

Commit 7c321a8

Browse files
committed
tentative switch to nf-test
1 parent 4281ac2 commit 7c321a8

File tree

6 files changed

+110
-79
lines changed

6 files changed

+110
-79
lines changed

modules/nf-core/oncocnv/main.nf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ process ONCOCNV {
2727
def normal = normal.join(',')
2828
def tumor = tumor.join(',')
2929
def VERSION = '7.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
30+
3031
"""
3132
perl \$(which ONCOCNV_getCounts.pl) \\
3233
getControlStats \\
@@ -70,4 +71,22 @@ process ONCOCNV {
7071
r: \$(R --version | grep "R version" | sed 's/R version //g')
7172
END_VERSIONS
7273
"""
74+
75+
stub:
76+
def VERSION = '7.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
77+
78+
// TODO add relevant files name
79+
"""
80+
touch stub.profile.png
81+
touch stub.profile.txt
82+
touch stub.summary.txt
83+
84+
cat <<-END_VERSIONS > versions.yml
85+
"${task.process}":
86+
oncocnv: $VERSION
87+
perl: \$(perl --version | grep 'This is perl' | sed 's/.*(v//g' | sed 's/)//g')
88+
r: \$(R --version | grep "R version" | sed 's/R version //g')
89+
END_VERSIONS
90+
"""
91+
7392
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// TODO nf-core: Once you have added the required tests, please run the following command to build this file:
2+
// nf-core modules test oncocnv
3+
nextflow_process {
4+
5+
name "Test Process ONCOCNV"
6+
script "../main.nf"
7+
process "ONCOCNV"
8+
9+
tag "modules"
10+
tag "modules_nfcore"
11+
tag "oncocnv"
12+
13+
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
14+
test("sarscov2 - bam") {
15+
16+
// TODO nf-core: If you are created a test for a chained module
17+
// (the module requires running more than one process to generate the required output)
18+
// add the 'setup' method here.
19+
// You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules).
20+
21+
when {
22+
process {
23+
"""
24+
input[0] = [
25+
[id:'test', single_end:false], // meta map
26+
[
27+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
28+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
29+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
30+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true),
31+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_markduplicates_sorted_bam'], checkIfExists: true),
32+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
33+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam_bai'], checkIfExists: true),
34+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_markduplicates_sorted_bam_bai'], checkIfExists: true),
35+
]
36+
]
37+
input[1] = file(params.test_data['homo_sapiens']['genome']['genome_21_annotated_bed'], checkIfExists: true)
38+
input[2] = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists:true)
39+
"""
40+
}
41+
}
42+
43+
then {
44+
assertAll(
45+
{ assert process.success },
46+
{ assert snapshot(process.out).match() }
47+
//TODO nf-core: Add all required assertions to verify the test output.
48+
// See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
49+
)
50+
}
51+
52+
}
53+
54+
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
55+
test("sarscov2 - bam - stub") {
56+
57+
options "-stub"
58+
59+
when {
60+
process {
61+
"""
62+
input[0] = [
63+
[id:'test', single_end:false], // meta map
64+
[
65+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
66+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
67+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
68+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true),
69+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_markduplicates_sorted_bam'], checkIfExists: true),
70+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
71+
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam_bai'], checkIfExists: true),
72+
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_markduplicates_sorted_bam_bai'], checkIfExists: true),
73+
]
74+
]
75+
input[1] = file(params.test_data['homo_sapiens']['genome']['genome_21_annotated_bed'], checkIfExists: true)
76+
input[2] = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists:true)
77+
"""
78+
}
79+
}
80+
81+
then {
82+
assertAll(
83+
{ assert process.success },
84+
{ assert snapshot(process.out).match() }
85+
//TODO nf-core: Add all required assertions to verify the test output.
86+
)
87+
}
88+
89+
}
90+
91+
}

tests/config/pytest_modules.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ nanomonsv/parse:
206206
ncbitools/vecscreen:
207207
- modules/nf-core/ncbitools/vecscreen/**
208208
- tests/modules/nf-core/ncbitools/vecscreen/**
209-
oncocnv:
210-
- modules/nf-core/oncocnv/**
211-
- tests/modules/nf-core/oncocnv/**
212209
paraclu:
213210
- modules/nf-core/paraclu/**
214211
- tests/modules/nf-core/paraclu/**

tests/modules/nf-core/oncocnv/main.nf

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/modules/nf-core/oncocnv/nextflow.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/modules/nf-core/oncocnv/test.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)