Skip to content

Commit

Permalink
Pull test improvements from master
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinband committed Aug 7, 2018
2 parents 536fa5f + 8679c92 commit 5c80f0c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
13 changes: 2 additions & 11 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
image: atlassian/default-image:latest
image: gavinband/ubuntu-14.04-build
pipelines:
default:
- step:
script:
- wget http://www.well.ox.ac.uk/~gav/resources/qctool_v2.0.1-Ubuntu14.04-x86_64.tgz
- tar -xzf qctool_v2.0.1-Ubuntu14.04-x86_64.tgz
- cp qctool_v2.0.1-Ubuntu14.04-x86_64/qctool /usr/bin/
- qctool
- apt-get install --assume-yes zlib1g-dev
- apt-get install --assume-yes python-pip
- python -m pip install robotframework
- qctool -g example/example.16bits.bgen -og /tmp/x.vcf
- ./waf configure
- ./waf
- cd test/functional
- mkdir -p test-reports/-o

- mkdir -p test-reports/
- pybot -o output.xml -l log.html -r report.html -d test-reports -x xunit.xml ./tests.txt

2 changes: 1 addition & 1 deletion test/functional/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
dir=$(dirname ${0})
basedir=${dir}/../..
echo ${dir}
pybot -o NONE -l NONE -r NONE -d ${basedir}/build/test/functional/test-reports -x xunit.xml ${dir}/tests.txt
pybot -o output.html -l log.html -r NONE -d ${basedir}/build/test/functional/test-reports -x xunit.xml ${dir}/tests.txt
38 changes: 38 additions & 0 deletions test/functional/test_rbgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
R="$1"
RBGEN="${2}"
if [[ ${R} == '' ]]; then
R='R'
fi
if [[ ${RBGEN} == '' ]]; then
RBGEN=build/R/rbgen
fi

${R} CMD INSTALL ${RBGEN}
${R} --vanilla << HERE_DOC
library( rbgen )
## Test we can load data
D = bgen.load( "example/example.16bits.bgen", ranges = data.frame( chromosome = '01', start = 0, end = 100000 ))
str( D )
head( D\$variants )
D\$data[1,1:10,1:3]
## Test we can load data on a subset of samples
samples = c( "sample_001", "sample_102", "sample_050", "sample_499" )
E = bgen.load( "example/example.16bits.bgen", ranges = data.frame( chromosome = '01', start = 0, end = 100000 ), samples = samples )
stopifnot( length( which( E\$data != D\$data[,samples,] ) ) == 0 )
stopifnot( length( which( D\$variants != E\$variants )) == 0 )
## Test we can load data for some specific rsid
rsids = c( "RSID_10", "RSID_20", "RSID_171", "RSID_9" )
F = bgen.load( "example/example.16bits.bgen", rsids = rsids )
str( F )
head( F\$variants )
F\$data
## Check we can load complex data
D = bgen.load( "example/complex.bgen", data.frame( chromosome = '01', start = 0, end = 1000000 ), max_entries_per_sample = 50 )
str(D)
HERE_DOC
4 changes: 4 additions & 0 deletions test/functional/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ${HOME} %{HOME}
${BUILDDIR} ${BASEDIR}/build
${TMPDIR} ${BUILDDIR}/test/functional/tmp
${BGENIX} ${BUILDDIR}/apps/bgenix
${RBGEN} ${BUILDDIR}/R/rbgen
${QCTOOL} qctool
${UNITTEST} ${BUILDDIR}/test/unit/test_bgen

Expand Down Expand Up @@ -39,6 +40,9 @@ Bgenix lists variants
${length}= Get length ${lines}
Should be equal as integers ${length} 202

Rbgen loads data
Run process ./test_rbgen.sh R ${RBGEN}

*** Keywords ***

Create empty temp directory
Expand Down

0 comments on commit 5c80f0c

Please sign in to comment.