-
Notifications
You must be signed in to change notification settings - Fork 315
/
run-bats.sh
executable file
·24 lines (20 loc) · 786 Bytes
/
run-bats.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Builds a "cleanroom" Docker container to run BATS tests in, and then
# executes the tests in that container, mounting the tests and Habitat
# binaries as needed.
if [ $# -eq 0 ] ; then
TESTS="."
else
TESTS="$*"
fi
docker build -t hab-bats-cleanroom "$(pwd)"/test/integration
docker run -it --rm \
--mount type=bind,source="$(pwd)/test/integration",target=/test \
--mount type=bind,source="$(pwd)/target/debug/hab-launch",target=/bin/hab-launch \
--mount type=bind,source="$(pwd)/target/debug/hab-sup",target=/bin/hab-sup \
--mount type=bind,source="$(pwd)/target/debug/hab",target=/bin/hab \
--env HAB_BIN_DIR=/bin \
--workdir=/test \
--name hab-bats \
hab-bats-cleanroom \
bats "${TESTS}"