forked from EFForg/https-everywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_travis.sh
executable file
·56 lines (51 loc) · 1.18 KB
/
run_travis.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
50
51
52
53
54
55
56
#!/bin/bash
set -x
toplevel=$(git rev-parse --show-toplevel)
testdir=${toplevel}/test/selenium
linter=${toplevel}/utils/eslint/node_modules/.bin/eslint
srcdir=${toplevel}/chromium
function run_lint {
$linter $srcdir
if [ $? != 0 ]; then
echo "Linting errors"
exit 1
fi
}
function run_unittests {
pushd ${srcdir}
npm run cover # run with coverage
if [ $? != 0 ]; then
echo "unittest errors"
exit 1
fi
npm run report
popd
}
function run_selenium {
ENABLE_XVFB=1 py.test -v --capture=no ${testdir} # autodiscover and run the tests
}
if [ "$INFO" == "lint" ]; then
echo "running lint tests"
run_lint
elif [ "$INFO" == "unittests" ]; then
echo "Running unittests"
run_unittests
elif [ "$INFO" == "rules" ] || [ "$INFO" == "fetch" ] || [ "$INFO" == "preloaded" ]; then
export TEST=${INFO}
${toplevel}/test/travis.sh # run old travis tests
else
case $BROWSER in
*chrome*)
echo "running tests on chrome"
run_selenium
;;
*firefox*)
echo "running tests on firefox"
run_selenium
;;
*)
echo "bad INFO variable, got $INFO"
exit 1
;;
esac
fi