---
# System prepended metadata

title: nf-test PR review checklist
tags: [nf-test]

---

# nf-test PR Review Checklist

## Rephrased

### Existing Modules Migrating from pytest to nf-test

1. Ensure all previous pytest assertions are converted to nf-test.
2. Confirm deletion of pytest files.
3. The module MUST use an `environment.yml` for conda environments. Previously, modules used a `conda=<name>=<version` statement in the `main.nf` file, which has since been replaced with a dedicated `environment.yml` file.

### New Modules

1. All output channels SHOULD be present in the nf-test snapshot file, or at a minimum, it MUST be verified that the files exist.

2. A stub test MUST exist for the module.

3. Tags for any dependent modules MUST be specified to ensure changes to upstream modules will re-trigger tests for the current module.

4. The `assertAll()` function MUST be used to specify an assertion, and there MUST be a minimum of one success assertion and versions in the snapshot.

5. There SHOULD be a test and assertions for each type of input input and parameter variation.
     - [Different assertion types](https://nf-co.re/docs/contributing/tutorials/nf-test_assertions) should be a straightforward `process.out` snapshot is not feasible.
    - Always check the snapshot to ensure that all outputs are correct! E.g., make sure there are no md5sums representing empty files

6. Tests names SHOULD describe the test dataset and configuration used. some examples below:

```groovy!
test("homo_sapiens - [fastq1, fastq2] - bam")
```

```groovy!
test("sarscov2 - [ cram, crai ] - fasta - fai")
```
        
```groovy!
test("Should search for zipped protein hits against a DIAMOND db and return a tab separated output file of hits")
```

7. For modules/sub-workflows, input data SHOULD be referenced with the `modules_testdata_base_path` parameter:
    
```groovy!
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
```


