Skip to content

Commit

Permalink
better test script structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kdm9 committed Jan 16, 2024
1 parent 83a3625 commit 540c554
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-snakemake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
shell: bash -el {0}
run: |
pushd tests
bash -el test.sh
bash -el test.sh --quick
popd
- name: cat all log files on failure
Expand Down
4 changes: 2 additions & 2 deletions acanthophis/template/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ samplesets:
callers:
- mpileup
- freebayes
# Deepvariant is disabled for Github actions tests, as it requires too much disk space
#- deepvariant
- deepvariant

# Which short read aligners to use for variant calling? (can be
# more/less/different to the align section above)
aligners:
Expand Down
10 changes: 0 additions & 10 deletions tests/quick.sh

This file was deleted.

6 changes: 2 additions & 4 deletions tests/setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash
mamba env update -f environment-setup.yml
conda activate acanthophis-tests
set -xeuo pipefail
rm -rf output/ tmp/
mkdir -p output/ tmp/ rawdata/
touch output/nobackup tmp/nobackup rawdata/nobackup
python3 -m pip install -e ../
set -xeuo pipefail
snakemake --version
snakemake --snakefile Snakefile.generate-rawdata -j 4 --software-deployment-method conda
snakemake --snakefile Snakefile.generate-rawdata -j $(nproc 2>/dev/null || echo 2) --software-deployment-method conda
tree rawdata
19 changes: 18 additions & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
#!/bin/bash
set -euo pipefail

# Reinstall acanthophis from git
conda activate acanthophis-tests
python3 -m pip uninstall --yes acanthophis
python3 -m pip install -e ..

# re-init after reinstall
acanthophis-init --yes

# recreate the conda env
mamba env update -f environment.yml
conda activate acanthophis

# Clear outputs
rm -fr output tmp
set -x
touch output/nobackup tmp/nobackup

# If quick, overwrite config with cut-back version
if [[ "$1" == "--quick" ]]
then
cp .config_quick.yml config.yml
shift
fi

# Run pipeline
snakemake -j $(nproc 2>/dev/null || echo 2) --software-deployment-method conda --ri "${@}"

0 comments on commit 540c554

Please sign in to comment.