-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tests.sh
42 lines (33 loc) · 997 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
#!/bin/bash
for i in $(grep "language.lang..\"" *.js | sed -e 's#.*lang.."##' | sed -e 's#".*##' | sort | uniq); do
cat translations.php | grep -q $i || echo "$i not found in translations.php"
done
if ! command -v python3 2>/dev/null >/dev/null; then
echo "python3 could not be found"
exit 1
fi
echo "====== Starting docker container ======"
bash docker.sh --local-port 1122
exit_code=$?
echo "====== Started docker container ======"
if [[ "$exit_code" -ne 0 ]]; then
echo "Could not start docker"
exit 255
fi
echo "====== Checking virtualenv ======"
if [[ ! -d ~/.asanai_test_env ]]; then
python3 -mvenv ~/.asanai_test_env
source ~/.asanai_test_env/bin/activate
pip3 install selenium || {
echo "pip3 install selenium failed. Are you online?"
rm -rf ~/.asanai_test_env
exit 1
}
fi
source ~/.asanai_test_env/bin/activate
echo "====== Checked virtualenv ======"
echo "====== Run tests ======"
python3 _run_tests.py
echo "====== Ran tests ======"
exit_code=$?
exit $exit_code