-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests
More file actions
executable file
·38 lines (36 loc) · 1.25 KB
/
run_tests
File metadata and controls
executable file
·38 lines (36 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
#!/usr/bin/env bash
function cleanup(){
kill $(ps -o pid= --ppid $$) || true
./clean_tests
exit 1
}
echo Initialising...
if [ "$VIRTUAL_ENV" == "" ]; then
source venv/bin/activate
fi
rm -f .coverage
echo Instrumenting JavaScript code...
set -e
trap 'cleanup' INT
./node_modules/.bin/nyc instrument --sourceMap=false -x 'js/ext/*' js instrumentedjs
cp -r js/ext instrumentedjs/ext
mv js _js
set +e
ln -s instrumentedjs js
export PATH=$PWD/node_modules/.bin:$PATH # This wasn't needed before???
echo Running tests in Google Chrome...
./node_modules/.bin/cypress run --browser chrome
chrome_result=$?
echo Running tests in Firefox...
./node_modules/.bin/cypress run --browser firefox
firefox_result=$?
./clean_tests
echo Generating reports...
coverage report --omit 'venv/**.py,/home/runner/.local/lib/python3.8/site-packages/**.py' -m
coverage lcov --omit 'venv/**.py,/home/runner/.local/lib/python3.8/site-packages/**.py' -o python_lcov.info
# The Cypress plugin does this already but for some reason confuses the instrumented JS for the normal JS. Bug?? This is a workaround.
./node_modules/.bin/nyc report --reporter=html
# Then show a text based report on the terminal
./node_modules/.bin/nyc report
let "result = $chrome_result + $firefox_result"
exit $result