Skip to content

Commit 3c1bbe5

Browse files
committed
Correct back reference to Hello World
1 parent a892610 commit 3c1bbe5

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

docs/side_quests/nf-test.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,66 @@ nf-test
4949
```
5050

5151
For a detailed description of the files, see the [warmup from Hello Nextflow](../hello_nextflow/00_orientation.md).
52+
The workflow we'll be testing is part of the workflow built in [Hello Workflow](../hello_nextflow/03_hello_workflow.md), and is composed of two processes: `sayHello` and `convertToUpper`:
53+
54+
```bash title="Workflow code"
55+
/*
56+
* Pipeline parameters
57+
*/
58+
params.input_file = "greetings.csv"
59+
60+
/*
61+
* Use echo to print 'Hello World!' to standard out
62+
*/
63+
process sayHello {
64+
65+
publishDir 'results', mode: 'copy'
66+
67+
input:
68+
val greeting
69+
70+
output:
71+
path "${greeting}-output.txt"
72+
73+
script:
74+
"""
75+
echo '$greeting' > '$greeting-output.txt'
76+
"""
77+
}
78+
79+
/*
80+
* Use a text replace utility to convert the greeting to uppercase
81+
*/
82+
process convertToUpper {
83+
84+
publishDir 'results', mode: 'copy'
85+
86+
input:
87+
path input_file
88+
89+
output:
90+
path "UPPER-${input_file}"
91+
92+
script:
93+
"""
94+
cat '$input_file' | tr '[a-z]' '[A-Z]' > UPPER-${input_file}
95+
"""
96+
}
97+
98+
workflow {
99+
100+
// create a channel for inputs from a CSV file
101+
greeting_ch = Channel.fromPath(params.input_file).splitCsv().flatten()
102+
103+
// emit a greeting
104+
sayHello(greeting_ch)
105+
106+
// convert the greeting to uppercase
107+
convertToUpper(sayHello.out)
108+
}
109+
```
110+
111+
We're going to assume an understanding of this workflow, but if you're not sure, you can refer back to [Hello Workflow](../hello_nextflow/03_hello_workflow.md).
52112

53113
### 0.1. Run the workflow
54114

@@ -613,7 +673,7 @@ Test Process sayHello
613673
FAILURE: Executed 1 tests in 4.884s (1 failed)
614674
```
615675

616-
The test fails because the `sayHello` process declares 1 input channel but 0 were specified. Let's fix that by adding an input to the process. Remember from part 1, our `sayHello` process takes a single value input. We should also fix the test name to better reflect what we're testing.
676+
The test fails because the `sayHello` process declares 1 input channel but 0 were specified. Let's fix that by adding an input to the process. Remember from [Hello Workflow](../hello_nextflow/03_hello_workflow.md) (and the warmup section above) that our `sayHello` process takes a single value input, which we will need to provide. We should also fix the test name to better reflect what we're testing.
617677

618678
**Before:**
619679

0 commit comments

Comments
 (0)