forked from elastic/apm-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·38 lines (32 loc) · 1.17 KB
/
run_tests.sh
File metadata and controls
executable file
·38 lines (32 loc) · 1.17 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
#!/usr/bin/env bash
set -e
export PATH=${HOME}/.local/bin:${PATH}
python -m pip install --user -U pip setuptools --cache-dir "${PIP_CACHE}"
python -m pip install --user -r "tests/requirements/reqs-${FRAMEWORK}.txt" --cache-dir "${PIP_CACHE}"
export PYTHON_VERSION=$(python -c "import platform; pv=platform.python_version_tuple(); print('pypy' + (str(pv[0])) if platform.python_implementation() == 'PyPy' else '.'.join(map(str, platform.python_version_tuple()[:2])))")
# check if the full FRAMEWORK name is in scripts/envs
if [[ -e "./tests/scripts/envs/${FRAMEWORK}.sh" ]]
then
source ./tests/scripts/envs/${FRAMEWORK}.sh
else
# check if only the first part of the FRAMEWORK is in scripts/envs
IFS='-'; frameworkParts=($FRAMEWORK); unset IFS;
if [[ -e "./tests/scripts/envs/${frameworkParts[0]}.sh" ]]
then
source ./tests/scripts/envs/${frameworkParts[0]}.sh
fi
fi
if [[ -n $WAIT_FOR_HOST ]]
then
echo "Waiting for $WAIT_FOR_HOST:$WAIT_FOR_PORT"
while ! nc -z $WAIT_FOR_HOST $WAIT_FOR_PORT; do
sleep 1
done
echo "$WAIT_FOR_HOST:$WAIT_FOR_PORT is up!"
fi
if [[ "$WITH_COVERAGE" == "true" ]]
then
make coverage
else
make test
fi