-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
45 lines (38 loc) · 881 Bytes
/
run_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
# !/bin/bash
run_tests(){
pytest --alluredir allure-results ./TaskTracker/tests/local_tests
}
show_allure_results(){
allure serve allure-results
}
help(){
echo "Script for running tests."
echo
echo "Syntax: scriptTemplate [-h|c]"
echo
echo "options:"
echo "h print this help information"
echo "c clean previous allure results"
echo
}
clean_allure_results(){
echo "Removing allure results \n"
rm -rf ./allure-results/*
}
OPEN_RESULTS=true
while getopts :coh flag; do
case $flag in
h) # Print help information
help
exit;;
c) # Clean previous allure results
clean_allure_results;;
\?) # Invalid option
echo "Error: Invalid option"
exit;;
esac
done
run_tests
if [[ $OPEN_RESULTS == true ]]; then
show_allure_results
fi