-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker_tests.sh
49 lines (46 loc) · 2.31 KB
/
docker_tests.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# This script will be run on Docker run, allowing users to immediately jump into usage of the test scripts.
# David Liu, 22 September 2020, Seattle, WA.
# Here, we will execute the tests by building a servicex.yaml file with the correct backend and credentials, running the tests, and then deleting the servicex.yaml file.
# First, if the user did not specify a custom endpoint, we use the defaults:
if [[ -z $3 ]];
then
if [[ $1 = 'uproot' ]] || [[ $1 = 'Uproot' ]];
then
printf "api_endpoints:\n - endpoint: https://uproot-atlas.servicex.ssl-hep.org/\n token: $2\n type: uproot" > ./servicex.yaml
pytest tests/test_uproot_functions.py
rm ./servicex.yaml
elif [[ $1 = 'xaod' ]] || [[ $1 = 'xAOD' ]];
then
printf "api_endpoints:\n - endpoint: https://xaod.servicex.ssl-hep.org/\n token: $2\n type: xaod" > ./servicex.yaml
pytest tests/test_xAOD_functions.py
rm ./servicex.yaml
elif [[ $1 = 'stress_xAOD' ]] || [[ $1 = 'Stress_xAOD' ]];
then
printf "api_endpoints:\n - endpoint: https://xaod.servicex.ssl-hep.org/\n token: $2\n type: xaod" > ./servicex.yaml
pytest --stress tests/test_large_xAOD_datasets.py
rm ./servicex.yaml
else
echo 'Invalid backend specified. Please enter a type of test you would like to run: xAOD, uproot, or stress, or specify a backend using its http address.'
fi
# if the user specified a custom endpoint, run the custom endpoint
else
if [[ $1 = 'uproot' ]] || [[ $1 = 'Uproot' ]];
then
printf "api_endpoints:\n - endpoint: $3\n token: $2\n type: uproot" > ./servicex.yaml
pytest tests/test_uproot_functions.py
rm ./servicex.yaml
elif [[ $1 = 'xaod' ]] || [[ $1 = 'xAOD' ]];
then
printf "api_endpoints:\n - endpoint: $3\n token: $2\n type: xaod" > ./servicex.yaml
pytest tests/test_xAOD_functions.py
rm ./servicex.yaml
elif [[ $1 = 'stress_xAOD' ]] || [[ $1 = 'Stress_xAOD' ]];
then
printf "api_endpoints:\n - endpoint: $3/\n token: $2\n type: xaod" > ./servicex.yaml
pytest --stress tests/test_large_xAOD_datasets.py
rm ./servicex.yaml
else
echo 'Invalid backend specified. Please enter a type of test you would like to run: xAOD, uproot, or stress_xAOD.'
fi
fi