1+ nextflow_process {
2+
3+ name "Test Process SEQFU_CHECK"
4+ script "../main.nf"
5+ process "SEQFU_CHECK"
6+
7+ tag "modules"
8+ tag "modules_nfcore"
9+ tag "seqfu"
10+ tag "seqfu/check"
11+
12+ test("sarscov2 - fastq - single-end") {
13+
14+ when {
15+ process {
16+ """
17+ input[0] = [[ id:'test', single_end:true ], // meta map
18+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
19+ ]
20+ """
21+ }
22+ }
23+
24+ then {
25+ assertAll(
26+ { assert process.success },
27+ { assert snapshot(process.out).match() }
28+ )
29+ }
30+
31+ }
32+
33+ test("sarscov2 - fastq - paired-end") {
34+
35+ when {
36+ process {
37+ """
38+ input[0] = [
39+ [ id:'test_paired', single_end:false ], // meta map
40+ [
41+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
42+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
43+ ]
44+ ]
45+ """
46+ }
47+ }
48+
49+ then {
50+ assertAll(
51+ { assert process.success },
52+ { assert snapshot(process.out).match() }
53+ )
54+ }
55+
56+ }
57+
58+ test("sarscov2 - fastq - directory") {
59+ when {
60+ process {
61+ """
62+ // stage input fastq files in a folder
63+ tmpdir = file("tmpdir", type: 'dir')
64+ tmpdir.mkdir()
65+ fastq_file_1 = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
66+ fastq_file_2 = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
67+ fastq_file_1.copyTo(tmpdir)
68+ fastq_file_2.copyTo(tmpdir)
69+
70+ // define inputs of the process here. Example:
71+ input[0] = [
72+ [ id:'test' ],
73+ [
74+ file(tmpdir, type:'dir', checkIfExists: true)
75+ ]
76+ ]
77+ """
78+ }
79+ }
80+ then {
81+ assertAll(
82+ { assert process.success },
83+ { assert snapshot(
84+ process.out,
85+ path(process.out.versions.get(0)).yaml
86+ ).match() }
87+ )
88+ }
89+ }
90+
91+ test("sarscov2 - fastq - single_end - stub") {
92+
93+ options "-stub"
94+
95+ when {
96+ process {
97+ """
98+ input[0] = [[ id:'test', single_end:true ], // meta map
99+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
100+ ]
101+ """
102+ }
103+ }
104+
105+ then {
106+ assertAll(
107+ { assert process.success },
108+ { assert snapshot(
109+ process.out,
110+ process.out.versions.collect{ path(it).yaml }.unique()
111+ ).match() }
112+ )
113+ }
114+
115+ }
116+
117+ }
0 commit comments