-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script for running integration tests
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
test -n "${METWORX_VERSION-}" || { | ||
printf >&2 'Metworx is required to run integration tests\n' | ||
exit 1 | ||
} | ||
|
||
# Note: BBI_TEST_ROOT must be under /data. | ||
root=${BBI_TEST_ROOT-/data/bbi-tests} | ||
mkdir -p "$root" | ||
tdir=$(mktemp -d "$root"/run-XXXXX) | ||
trap 'rm -rf "$tdir"' 0 | ||
|
||
BBI_GRID_NAME_PREFIX=$(basename "$tdir") | ||
export BBI_GRID_NAME_PREFIX | ||
export LOCAL=true | ||
export MPIEXEC_PATH=/usr/bin/mpiexec | ||
export NMQUAL=false | ||
export NMVERSION=nm75 | ||
export NMVERSION_NMQUAL=nm74gf | ||
export NONMEMROOT=/opt/NONMEM | ||
export POST_EXECUTION=true | ||
export ROOT_EXECUTION_DIR="$tdir" | ||
export SGE=true | ||
export SGE_ARCH=lx-amd64 | ||
export SGE_CELL=default | ||
export SGE_CLUSTER_NAME=p6444 | ||
export SGE_EXECD_PORT=6445 | ||
export SGE_QMASTER_PORT=6444 | ||
export SGE_ROOT=/opt/sge | ||
|
||
bin=$tdir/bin | ||
mkdir "$bin" | ||
|
||
if test -n "${GOCOVERDIR-}" | ||
then | ||
printf >&2 'building binary with -cover\n' | ||
coverarg=-cover | ||
else | ||
coverarg= | ||
fi | ||
|
||
version=$(git describe --always --dirty) | ||
|
||
# shellcheck disable=SC2086 | ||
go build $coverarg \ | ||
-ldflags "-X github.com/metrumresearchgroup/bbi/cmd.VERSION=$version" \ | ||
-o "$bin/bbi" cmd/bbi/main.go | ||
|
||
export PATH="$bin:$PATH" | ||
|
||
printf >&2 'bbi path: %s\nbbi version: %s\n' \ | ||
"$(command -v bbi)" "$(bbi version)" | ||
|
||
cd integration | ||
bbi init --dir /opt/NONMEM --threads 2 | ||
|
||
go test -count 1 "$@" ./... |