-
Notifications
You must be signed in to change notification settings - Fork 246
Update nf-test guide with chapter #3474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
03 - testing modules 04 - testing subworkflows
✅ Deploy Preview for nf-core-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nf-core-main-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Updated titles and subtitles for clarity. - Enhanced descriptions of testing processes and principles. - Improved syntax examples and added comments for better understanding. - Clarified the use of setup blocks and input parameters in tests. - Emphasized the importance of MD5 checksums for BAM file testing.
- Clarified the relationship between module and subworkflow testing concepts. - Expanded on the use of `params` blocks for parameter management in tests. - Added examples for loading parameters from files and combining techniques. - Improved explanations of setup blocks for handling dependencies in subworkflows. - Updated essential assertions and testing principles for better comprehension.
|
||
### Basic test syntax | ||
|
||
The basic syntax for a process test follows this structure: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would start by mentioning the file structure of a module.
Your previous chapter only really focused on pipeline level tests, not modules
|
||
The basic syntax for a process test follows this structure: | ||
|
||
```groovy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```groovy | |
```groovy title="main.nf.test" |
Or whatever we call it
|
||
### Essential Assertions | ||
|
||
Tests use assertions to verify the expected output of the process in the `then` block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests use assertions to verify the expected output of the process in the `then` block. | |
Tests use assertions to verify the expected output of the process specified in the `then` block. |
|
||
Tests use assertions to verify the expected output of the process in the `then` block. | ||
|
||
To report multiple failures in a single test run, group your assertions within an `assertAll` block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To report multiple failures in a single test run, group your assertions within an `assertAll` block. | |
You can specify multiple assertions to be evaluated together in a single test by specifying them within an `assertAll` block. |
I don't understand this, why are you tracking failures?
|
||
To report multiple failures in a single test run, group your assertions within an `assertAll` block. | ||
|
||
Channels that lack explicit names can be addressed using square brackets and the corresponding index, for example `process.out[0]` for the first channel. This indexing method provides a straightforward way to interact with channels without the need for predefined names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Channels that lack explicit names can be addressed using square brackets and the corresponding index, for example `process.out[0]` for the first channel. This indexing method provides a straightforward way to interact with channels without the need for predefined names. | |
Nextflow process output channels that lack explicit names can be addressed using square brackets and the corresponding index, for example `process.out[0]` for the first channel. This indexing method provides a straightforward way to interact with channels without the need for predefined names. |
But what if you have meta/file tuples? If you describe this later on, I would have a link down to it at the bottom
|
||
## Testing parameter variations | ||
|
||
Test different parameter combinations that affect subworkflow behavior: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test different parameter combinations that affect subworkflow behavior: | |
You should make sure to test different parameter combinations that could affect subworkflow behavior. | |
You can do this with nextflow config files that sit alongside the `main.nf.test` file. |
|
||
### Overriding parameters with the `params` block | ||
|
||
In addition to a `nextflow.config` file, `nf-test` provides a `params` block within the `when` block to override Nextflow's input `params` for a specific test. This is useful for testing different parameter combinations without creating multiple config files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to a `nextflow.config` file, `nf-test` provides a `params` block within the `when` block to override Nextflow's input `params` for a specific test. This is useful for testing different parameter combinations without creating multiple config files. | |
In addition to a `nextflow.config` file, `nf-test` provides a `params` block within the `when` block to override Nextflow's input `params` for a specific test. | |
This is useful for testing different parameter combinations without creating multiple config files. |
Again I would pick one method and stick wit hit
output { | ||
dir = "output" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe give a more realiastic example likthe bismark in the example above
|
||
#### Loading parameters from a file | ||
|
||
You can also load parameters from a JSON or YAML file. This is useful for managing complex parameter sets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What sor tof JSON/YAML file, you mean a nextflow one?
|
||
## Testing output channels comprehensively | ||
|
||
### BAM file testing with MD5 checksums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you singling out BAMs here? Also this is using a plugin not mentioned her yet.
I think these two sections make more sense for the assertion chaper.
03 - testing modules
04 - testing subworkflows
@netlify /docs/tutorials/tests_and_test_data/components/03_testing_modules