Update commands for pytest

This commit is contained in:
drpatelh 2021-02-07 23:50:21 +00:00
parent 07f62a76c5
commit 9cb958ca25

View file

@ -236,20 +236,38 @@ We also use a standardised parameter called `params.publish_dir_mode` that can b
- Any outputs produced by the test workflow MUST be included in the [pytest-workflow](https://pytest-workflow.readthedocs.io/en/stable) for that tool e.g. [`tests/software/fastqc/test.yml`](tests/software/fastqc/test.yml). `md5sum` checks are the preferable choice of test to determine file changes, however, this may not be possible for all outputs generated by some tools e.g. if they include time stamps or command-related headers. Please do your best to avoid just checking for the file being present e.g. it may still be possible to check that the file contains the appropriate text snippets. - Any outputs produced by the test workflow MUST be included in the [pytest-workflow](https://pytest-workflow.readthedocs.io/en/stable) for that tool e.g. [`tests/software/fastqc/test.yml`](tests/software/fastqc/test.yml). `md5sum` checks are the preferable choice of test to determine file changes, however, this may not be possible for all outputs generated by some tools e.g. if they include time stamps or command-related headers. Please do your best to avoid just checking for the file being present e.g. it may still be possible to check that the file contains the appropriate text snippets.
- A filter for the module must be created in [`.github/filters.yml`](.github/filters.yml). Please include any paths specific for that tool or upstream of that tool (For example bowtie build is upstream of bowtie align). - A filter for the module must be created in [`.github/filters.yml`](.github/filters.yml). If the test workflow you have created invokes more than one tool please include any paths specific for those tool's too e.g. `bowtie build` is upstream of `bowtie align` and they have both been chained together to test the latter.
#### Running Tests Locally #### Running Tests Locally
0. Have either `docker`, `singularity` or `conda` installed 1. Install [`nextflow`](https://nf-co.re/usage/installation)
1. See [pytest-workflow installation](https://pytest-workflow.readthedocs.io/en/stable/#installation) for directions to install
2. Run
``` bash 2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/) or [`Conda`](https://conda.io/miniconda.html)
PROFILE=docker pytest --tag new_module --symlink --wt 2 --kwdof
PROFILE=conda pytest --tag new_module --symlink --wt 2 --kwdof 3. Install [pytest-workflow](https://pytest-workflow.readthedocs.io/en/stable/#installation)
TMPDIR=~ PROFILE=singularity pytest --tag new_module --symlink --wt 2 --kwdof
alias nf-test="PROFILE=docker pytest --tag new_module --symlink --wt 2 --kwdof" 4. Start running your own tests!
```
- Typical command with Docker:
```console
cd /<PATH>/<TO>/<GIT>/<CLONE>/<NF-CORE>/<MODULES>/
PROFILE=docker pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd
```
- Typical command with Singularity:
```console
cd /<PATH>/<TO>/<GIT>/<CLONE>/<NF-CORE>/<MODULES>/
TMPDIR=~ PROFILE=singularity pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd
```
- Typical command with Conda:
```console
cd /<PATH>/<TO>/<GIT>/<CLONE>/<NF-CORE>/<MODULES>/
PROFILE=conda pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd
```
### Documentation ### Documentation