Skip to content

Commit e8a976a

Browse files
committed
prettier
1 parent 499dfc1 commit e8a976a

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

docs/side_quests/nf-test.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ As you develop your pipeline, it will quickly become so complex that manually te
1313

1414
Testing allows you to systematically check that every part of your pipeline is working as expected. The benefits to a developer are huge:
1515

16-
- **Confidence**: Because the tests cover the entire pipeline, you can be be confident changing something doesn't affect anything else
17-
- **Trust**: When multiple developers work on the pipeline, they know the other developers haven't broken the pipeline and every component.
18-
- **Transparency**: The tests show where a pipeline is failing and make it easier to track down the problem. They also function as a form of documentation, showing how to run a process or workflow.
19-
- **Speed**: Because the tests are automated, they can be run very quickly and repeatedly. You can iterate quickly with less fear of introducing new bugs.
16+
- **Confidence**: Because the tests cover the entire pipeline, you can be be confident changing something doesn't affect anything else
17+
- **Trust**: When multiple developers work on the pipeline, they know the other developers haven't broken the pipeline and every component.
18+
- **Transparency**: The tests show where a pipeline is failing and make it easier to track down the problem. They also function as a form of documentation, showing how to run a process or workflow.
19+
- **Speed**: Because the tests are automated, they can be run very quickly and repeatedly. You can iterate quickly with less fear of introducing new bugs.
2020

2121
There are lots of different types of tests we can write:
2222

@@ -157,13 +157,13 @@ We'll take a second to understand the structure of the test file.
157157

158158
The `nextflow_pipeline` block is the entry point for all pipeline level tests. It contains the following:
159159

160-
- `name`: The name of the test.
161-
- `script`: The path to the pipeline script.
160+
- `name`: The name of the test.
161+
- `script`: The path to the pipeline script.
162162

163163
The `test` block is the actual test. It contains the following:
164164

165-
- `when`: The conditions under which the test should be run. This includes the parameters that will be used to run the pipeline.
166-
- `then`: The assertions that should be made. This includes the expected outcomes of the pipeline.
165+
- `when`: The conditions under which the test should be run. This includes the parameters that will be used to run the pipeline.
166+
- `then`: The assertions that should be made. This includes the expected outcomes of the pipeline.
167167

168168
In plain English, the logic of the test reads as follows:
169169
"**When** these _parameters_ are provided to this _pipeline_, **then** we expect to see these results."
@@ -573,8 +573,8 @@ This represents the outputs created by the `sayHello` process, which we are test
573573

574574
If, in the course of future development, something in the code changes that causes the output to be different, the test will fail and we will have to determine whether the change is expected or not.
575575

576-
- If it turns out that something in the code broke, we will have to fix it, with the expectation that the fixed code will pass the test.
577-
- If it is an expected change (e.g., the tool has been improved and the results are better) then we will need to update the snapshot to accept the new output as the reference to match. nf-test has a parameter `--update-snapshot` for this purpose.
576+
- If it turns out that something in the code broke, we will have to fix it, with the expectation that the fixed code will pass the test.
577+
- If it is an expected change (e.g., the tool has been improved and the results are better) then we will need to update the snapshot to accept the new output as the reference to match. nf-test has a parameter `--update-snapshot` for this purpose.
578578

579579
For now though, we can run the test again and see the test should pass:
580580

@@ -636,9 +636,9 @@ This is a similar test to the `sayHello` process, but it's testing the `convertT
636636

637637
We now need to supply a single input file to the convertToUpper process, which includes some text that we want to convert to uppercase. There are lots of ways we could do this:
638638

639-
- We could create a dedicated file to test
640-
- We could re-use the existing data/greetings.csv file
641-
- We could create it on the fly within the test
639+
- We could create a dedicated file to test
640+
- We could re-use the existing data/greetings.csv file
641+
- We could create it on the fly within the test
642642

643643
For now, let's re-use the existing data/greetings.csv file using the example we used with the pipeline level test.
644644

@@ -775,6 +775,7 @@ In this side quest, we've learned:
775775
5. How to run all tests in a repository with a single command
776776

777777
Testing is a critical part of pipeline development that helps ensure:
778+
778779
- Your code works as expected
779780
- Changes don't break existing functionality
780781
- Other developers can contribute with confidence
@@ -783,6 +784,7 @@ Testing is a critical part of pipeline development that helps ensure:
783784
### What's next?
784785

785786
Check out the [nf-test documentation](https://www.nf-test.com/) for more advanced testing features and best practices. You might want to:
787+
786788
- Add more comprehensive assertions to your tests
787789
- Write tests for edge cases and error conditions
788790
- Set up continuous integration to run tests automatically

0 commit comments

Comments
 (0)