diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..41287810da6ed779275f23838b0658e3607e3a51 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,9 @@ +default: + tags: + - shell + +test: + script: + - docker build -t imagetest:latest . + - false + - docker run --rm -it imagetest:latest tests/test.sh diff --git a/tests/expected_output.md5 b/tests/expected_output.md5 new file mode 100644 index 0000000000000000000000000000000000000000..3319e18eb283216515a9aadf2c72fec19bd867e7 --- /dev/null +++ b/tests/expected_output.md5 @@ -0,0 +1 @@ +6b5a66981bd83329219002897be393a6 test.test-mir.min.1.pileup.tab diff --git a/tests/test.sh b/tests/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..0ccc00933907d5ad514d3fe3f3ac757848b3b475 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Tear down test environment +cleanup () { + rc=$? + rm "test.test-mir.min.1.pileup.tab" + 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 + +ascii_alignment_pileup.R \ + --verbose \ + --reference="test_files/test.fa.gz" \ + --annotations="test_files/test.gff" \ + --output-directory="$PWD" \ + "test_files/test.bed" \ + "test_files/test.bam" + +# Check md5 sum of output file +md5sum --check "expected_output.md5"