split up unit-tests and use 4 containers (they're free)
This commit is contained in:
4
tests.mk
4
tests.mk
@@ -61,7 +61,11 @@ lint:
|
|||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
@echo running unit tests...
|
@echo running unit tests...
|
||||||
|
ifndef UNIT_TEST_BATCH
|
||||||
@$(QUIET) bats tests/unit
|
@$(QUIET) bats tests/unit
|
||||||
|
else
|
||||||
|
@$(QUIET) ./tests/ci/unit_test_runner.sh $$UNIT_TEST_BATCH
|
||||||
|
endif
|
||||||
|
|
||||||
deploy-test-clojure:
|
deploy-test-clojure:
|
||||||
@echo deploying config app...
|
@echo deploying config app...
|
||||||
|
|||||||
@@ -2,16 +2,21 @@
|
|||||||
|
|
||||||
case "$CIRCLE_NODE_INDEX" in
|
case "$CIRCLE_NODE_INDEX" in
|
||||||
0)
|
0)
|
||||||
echo "=====> make unit-tests"
|
echo "=====> make unit-tests (1/2)"
|
||||||
sudo -E make -e unit-tests
|
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
|
||||||
;;
|
;;
|
||||||
|
|
||||||
1)
|
1)
|
||||||
|
echo "=====> make unit-tests (2/2)"
|
||||||
|
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
|
||||||
|
;;
|
||||||
|
|
||||||
|
2)
|
||||||
echo "=====> make deploy-tests (buildstep release)"
|
echo "=====> make deploy-tests (buildstep release)"
|
||||||
sudo -E make -e deploy-tests
|
sudo -E make -e deploy-tests
|
||||||
;;
|
;;
|
||||||
|
|
||||||
2)
|
3)
|
||||||
echo "=====> make deploy-tests (buildstep master)"
|
echo "=====> make deploy-tests (buildstep master)"
|
||||||
docker rmi -f progrium/buildstep && \
|
docker rmi -f progrium/buildstep && \
|
||||||
sudo -E BUILD_STACK=true make -e stack && \
|
sudo -E BUILD_STACK=true make -e stack && \
|
||||||
|
|||||||
37
tests/ci/unit_test_runner.sh
Executable file
37
tests/ci/unit_test_runner.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
is_number() {
|
||||||
|
local NUMBER=$1; local NUM_RE='^[0-9]+$'
|
||||||
|
if [[ $NUMBER =~ $NUM_RE ]];then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $0 1|2"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
BATCH_NUM="$1"
|
||||||
|
is_number $BATCH_NUM || usage
|
||||||
|
|
||||||
|
TESTS=( $(find $(dirname $0)/../unit -maxdepth 1 -name "*.bats") )
|
||||||
|
HALF_TESTS=$(( ${#TESTS[@]} / 2 ))
|
||||||
|
FIRST_HALF=${TESTS[@]:0:${HALF_TESTS}}
|
||||||
|
LAST_HALF=${TESTS[@]:${HALF_TESTS}:${#TESTS[@]}}
|
||||||
|
|
||||||
|
case "$BATCH_NUM" in
|
||||||
|
1)
|
||||||
|
bats $FIRST_HALF
|
||||||
|
;;
|
||||||
|
|
||||||
|
2)
|
||||||
|
bats $LAST_HALF
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user