Skip to content

Commit c5cda60

Browse files
committed
Revert "Remove manual section numberings clashing with mkdocs"
This reverts commit da64c2a.
1 parent 764e88b commit c5cda60

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/side_quests/nf-test.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In this part of the training, we're going to show you how to use nf-test to writ
3131

3232
---
3333

34-
## Warmup
34+
## 0. Warmup
3535

3636
Let's move into the project directory.
3737

@@ -110,7 +110,7 @@ workflow {
110110

111111
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).
112112

113-
### Run the workflow
113+
### 0.1. Run the workflow
114114

115115
Let's run the workflow to make sure it's working as expected.
116116

@@ -150,7 +150,7 @@ Initialize `nf-test`.
150150

151151
---
152152

153-
## Initialize `nf-test`
153+
## 1.0. Initialize `nf-test`
154154

155155
The `nf-test` package provides an initialization command that sets up a few things in order for us to start developing tests for our project.
156156

@@ -170,7 +170,7 @@ Project configured. Configuration is stored in nf-test.config
170170

171171
It also creates a `tests` directory containing a configuration file stub.
172172

173-
## Generate an nf-test
173+
## 1.1. Generate an nf-test
174174

175175
`nf-test` comes with a set of tools for building nf-test files, saving us the majority of the work. These come under the subcommand `generate`. Let's generate a test for the pipeline:
176176

@@ -255,7 +255,7 @@ Good test names should:
255255

256256
As we add more assertions and specific test cases later, we'll use these more descriptive names to make it clear what each test is verifying.
257257

258-
## Run the test
258+
## 1.2. Run the test
259259

260260
Let's run the test to see what happens.
261261

@@ -401,7 +401,7 @@ Test Workflow main.nf
401401
SUCCESS: Executed 1 tests in 5.239s
402402
```
403403

404-
## Add assertions
404+
## 1.3. Add assertions
405405

406406
A simple check is to ensure our pipeline is running all the processes we expect and not skipping any silently. Remember our pipeline runs 6 processes, one called `sayHello` and one called `convertToUpper` for each of the 3 greetings.
407407

@@ -468,7 +468,7 @@ SUCCESS: Executed 1 tests in 1.588s
468468

469469
Success! The pipeline runs successfully and the test passes. Now we have began to test the details of the pipeline, as well as the overall status.
470470

471-
## Test the output
471+
## 1.4. Test the output
472472

473473
Let's add an assertion to our test to check the output file was created. We'll add it as a separate test, with an informative name, to make the results easier to interpret.
474474

@@ -566,11 +566,11 @@ Learn how to test a Nextflow process.
566566

567567
---
568568

569-
## Test a Nextflow process
569+
## 2 Test a Nextflow process
570570

571571
We don't have to write tests for every part of the pipeline, but the more tests we have the more comprehensive we can be about the pipeline and the more confident we can be that it's working as expected. In this section we're going to test both processes in the pipeline as individual units.
572572

573-
### Test the `sayHello` process
573+
### 2.1. Test the `sayHello` process
574574

575575
Let's start with the `sayHello` process.
576576

@@ -741,7 +741,7 @@ SUCCESS: Executed 1 tests in 1.611s
741741

742742
Success! The test passes because the `sayHello` process ran successfully and the output was created.
743743

744-
### Check out the snapshot created by the test
744+
### 2.2. Check out the snapshot created by the test
745745

746746
If we look at the `tests/main.sayhello.nf.test` file, we can see it uses a method `snapshot()` in the assertion block:
747747

@@ -794,7 +794,7 @@ SUCCESS: Executed 1 tests in 1.685s
794794

795795
Success! The test passes because the `sayHello` process ran successfully and the output matched the snapshot.
796796

797-
### Alternative to Snapshots: Direct Content Assertions
797+
### 2.3 Alternative to Snapshots: Direct Content Assertions
798798

799799
While snapshots are great for catching any changes in output, sometimes you want to verify specific content without being so strict about the entire file matching. For example:
800800

@@ -888,7 +888,7 @@ Test Process sayHello
888888
SUCCESS: Executed 1 tests in 7.208s
889889
```
890890

891-
### Test the `convertToUpper` process
891+
### 2.4. Test the `convertToUpper` process
892892

893893
Let's open the `tests/main.converttoupper.nf.test` file and take a look at the contents:
894894

@@ -1042,15 +1042,15 @@ You know how to write tests for a Nextflow process and run them.
10421042

10431043
Learn how to run tests for everything at once!
10441044

1045-
## Run tests for the entire repository
1045+
## 3. Run tests for the entire repository
10461046

10471047
Running nf-test on each component is fine, but laborious and error prone. Can't we just test a test on everything at once?
10481048

10491049
Yes we can!
10501050

10511051
Let's run nf-test on the entire repo.
10521052

1053-
### Run nf-test on the entire repo
1053+
### 3.1. Run nf-test on the entire repo
10541054

10551055
We can run nf-test on the entire repo by running the `nf-test test` command.
10561056

@@ -1087,7 +1087,7 @@ SUCCESS: Executed 3 tests in 5.007s
10871087

10881088
Check that out! We ran 3 tests, 1 for each process and 1 for the whole pipeline with a single command. Imagine how powerful this is on a large codebase!
10891089

1090-
## Summary
1090+
## 4.0. Summary
10911091

10921092
In this side quest, we've learned:
10931093

0 commit comments

Comments
 (0)