This demonstrates how to test your Snakefile with pytest.
Snakemake will be run in --dryrun
mode to verify that the inputs in the all
rule can be generated.
It will also make sure there are no syntax errors and run linting (--lint
).
This is done all programatically (no "shelling out")
This does not support the checkpoint directive.
This does not support testing on real data and having the rules actually run.
This is something you should do.
Set the dryrun
parameter to False
in the call to snakemake.snakemake
.
Make sure that your input files "make sense" given the workflow you are running.
Also make sure any required software is installed or accessible.
For example, a small set of reads in a FASTQ as input over a single exon to test variant calling.
And then make sure bwa
, samtools
, and gatk4
are installed.
-
Create the
snakemake-pytest
conda environment
conda env create --file src/environment.yml
- Activate the
snakemake-pytest
conda environment
conda activate snakemake-pytest
- Run the integration tests
bash ci/check.sh