-
Notifications
You must be signed in to change notification settings - Fork 845
Expand file tree
/
Copy pathrun-unit-tests.sh
More file actions
executable file
·40 lines (35 loc) · 1.25 KB
/
run-unit-tests.sh
File metadata and controls
executable file
·40 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -eu -o pipefail
#######################################
# main function to run the unit tests
# Global env vars:
# UAA_DOCKER_ARGS: Additional args to pass to docker run
# UAA_GRADLE_UNIT_TEST_COMMAND: Gradle command to run unit tests (default: test)
# this could include :cloudfoundry-identity-server:test --tests to run specific tests
#######################################
main() {
local script_dir; script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${script_dir}/scripts/lib_timer.sh"
start_timer
local container_script_dir="/root/uaa"
local gradle_lock_dir="/root/uaa/.gradle/"
source "${script_dir}/scripts/lib_database_variants.sh"
parse_db_name "${1:-}"
echo "Using docker image: ${DOCKER_IMAGE}, DB=${DB}, PROFILE_NAME=${PROFILE_NAME}"
echo
docker pull "${DOCKER_IMAGE}"
docker run \
--privileged \
--tty \
--interactive \
--platform linux/amd64 \
--shm-size=1G \
--volume "${script_dir}":"${container_script_dir}" \
--volume "${gradle_lock_dir}" \
--env DB="${DB}" \
${UAA_DOCKER_ARGS:-} \
--env UAA_GRADLE_UNIT_TEST_COMMAND="${UAA_GRADLE_UNIT_TEST_COMMAND:-test}" \
"${DOCKER_IMAGE}" \
/root/uaa/scripts/unit_tests.sh "${PROFILE_NAME}"
}
main "$@"