From 9cb958ca256cf5b67b6522dbc9ef390338708f10 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Sun, 7 Feb 2021 23:50:21 +0000 Subject: [PATCH] Update commands for pytest --- README.md | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2fc2eb83..95602504 100644 --- a/README.md +++ b/README.md @@ -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. -- 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 -0. Have either `docker`, `singularity` or `conda` installed -1. See [pytest-workflow installation](https://pytest-workflow.readthedocs.io/en/stable/#installation) for directions to install -2. Run +1. Install [`nextflow`](https://nf-co.re/usage/installation) -``` bash -PROFILE=docker pytest --tag new_module --symlink --wt 2 --kwdof -PROFILE=conda pytest --tag new_module --symlink --wt 2 --kwdof -TMPDIR=~ PROFILE=singularity pytest --tag new_module --symlink --wt 2 --kwdof -alias nf-test="PROFILE=docker pytest --tag new_module --symlink --wt 2 --kwdof" -``` +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) + +3. Install [pytest-workflow](https://pytest-workflow.readthedocs.io/en/stable/#installation) + +4. Start running your own tests! + + - Typical command with Docker: + + ```console + cd /////// + PROFILE=docker pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd + ``` + + - Typical command with Singularity: + + ```console + cd /////// + TMPDIR=~ PROFILE=singularity pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd + ``` + + - Typical command with Conda: + + ```console + cd /////// + PROFILE=conda pytest --tag tests/software/bowtie/build --symlink --wt 2 --keep-workflow-wd + ``` ### Documentation