diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01b203c..db08de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: run: bash tests/test_integration_workflow/test.local.sh - name: Run htsinfer test script - run: bash tests/test_htsinfer_workflow/test.local.sh + run: bash tests/test_htsinfer_with_singularity/test.local.sh - name: Run SRA downloads workflow run: bash tests/test_sra_download_with_singularity/test.local.sh @@ -208,6 +208,9 @@ jobs: - name: Run test script run: bash tests/test_integration_workflow_with_conda/test.local.sh + - name: Run htsinfer test script + run: bash tests/test_htsinfer_with_conda/test.local.sh + - name: Run SRA downloads workflow run: bash tests/test_sra_download_with_conda/test.local.sh diff --git a/tests/test_htsinfer_workflow/expected_output.md5 b/tests/test_htsinfer_with_conda/expected_output.md5 similarity index 100% rename from tests/test_htsinfer_workflow/expected_output.md5 rename to tests/test_htsinfer_with_conda/expected_output.md5 diff --git a/tests/test_htsinfer_with_conda/test.local.sh b/tests/test_htsinfer_with_conda/test.local.sh new file mode 100755 index 0000000..7006c30 --- /dev/null +++ b/tests/test_htsinfer_with_conda/test.local.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# This script is currently exiting with non-zero status. +# This is expected behaviour though, as several parameters can't be inferred from the test files. +# Snakemake called with --keep-incomplete in order to keep the created samples table for inspection. + +# Tear down test environment +cleanup () { + rc=$? + rm -rf .cache/ + rm -rf .config/ + rm -rf .fontconfig/ + rm -rf .java/ + rm -rf .snakemake/ + rm -rf logs/ + rm -rf results/ + rm -rf Log.out + cd $user_dir + echo "Exit status: $rc" +} +trap cleanup EXIT + +# Set up test environment +set -eo pipefail # ensures that script exits at first command that exits with non-zero status +set -u # ensures that script exits when unset variables are used +set -x # facilitates debugging by printing out executed commands +user_dir=$PWD +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +cd $script_dir + +# Run tests +snakemake \ + --snakefile="../../workflow/rules/htsinfer.smk" \ + --restart-times=0 \ + --profile="../../profiles/local-conda" \ + --config outdir="results" \ + samples="../input_files/htsinfer_samples.tsv" \ + samples_out="samples_htsinfer.tsv" \ + log_dir="logs" \ + cluster_log_dir="logs/cluster_log" \ + --notemp \ + --keep-incomplete + +# Check md5 sum of some output files +md5sum --check "expected_output.md5" diff --git a/tests/test_htsinfer_with_singularity/expected_output.md5 b/tests/test_htsinfer_with_singularity/expected_output.md5 new file mode 100644 index 0000000..22e9037 --- /dev/null +++ b/tests/test_htsinfer_with_singularity/expected_output.md5 @@ -0,0 +1,3 @@ +1dc3f566f896b72f8f0ab8b3d60da364 results/samples_htsinfer.tsv +ca3f9ef26821bfa061d3b7708823ebc3 results/htsinfer_SRR1.json +62303261f8dd73124c2a5a54cd28e572 results/htsinfer_SRR2.json diff --git a/tests/test_htsinfer_workflow/test.local.sh b/tests/test_htsinfer_with_singularity/test.local.sh similarity index 100% rename from tests/test_htsinfer_workflow/test.local.sh rename to tests/test_htsinfer_with_singularity/test.local.sh diff --git a/workflow/envs/htsinfer.yaml b/workflow/envs/htsinfer.yaml index c25f872..f5a1c0e 100644 --- a/workflow/envs/htsinfer.yaml +++ b/workflow/envs/htsinfer.yaml @@ -2,5 +2,5 @@ channels: - bioconda dependencies: - - htsinfer=0.10.0 + - htsinfer=0.11.0 ... diff --git a/workflow/rules/htsinfer.smk b/workflow/rules/htsinfer.smk index c67e299..8aa5097 100644 --- a/workflow/rules/htsinfer.smk +++ b/workflow/rules/htsinfer.smk @@ -49,7 +49,7 @@ rule run_htsinfer: cluster_log_path=CLUSTER_LOG, threads: 4 singularity: - "docker://zavolab/htsinfer:latest" + "docker://quay.io/biocontainers/htsinfer:0.11.0--pyhdfd78af_1" conda: os.path.join(workflow.basedir, "..", "envs", "htsinfer.yaml") log: @@ -82,7 +82,7 @@ rule htsinfer_to_tsv: SAMPLES_OUT, threads: 4 singularity: - "docker://zavolab/htsinfer:latest" + "docker://quay.io/biocontainers/htsinfer:0.11.0--pyhdfd78af_1" conda: os.path.join(workflow.basedir, "..", "envs", "htsinfer.yaml") log: