diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 19:47:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 19:47:39 +0000 |
commit | 8d13bdc6cac0e20c43c6f909fc0208774b9c5c84 (patch) | |
tree | 5fd46925c6b4a881c9208772ed8e5cc0588bc164 /scripts/run_travis.sh | |
parent | Initial commit. (diff) | |
download | privacybadger-8d13bdc6cac0e20c43c6f909fc0208774b9c5c84.tar.xz privacybadger-8d13bdc6cac0e20c43c6f909fc0208774b9c5c84.zip |
Adding upstream version 2020.10.7.upstream/2020.10.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/run_travis.sh')
-rwxr-xr-x | scripts/run_travis.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/run_travis.sh b/scripts/run_travis.sh new file mode 100755 index 0000000..fa20fdb --- /dev/null +++ b/scripts/run_travis.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +toplevel=$(git rev-parse --show-toplevel) +testdir=${toplevel}/tests/selenium + +function run_lint { + if ! make -C "$toplevel" lint; then + echo "Linting errors" + exit 1 + fi +} + +function run_selenium { + # autodiscover and run the tests + pytest --capture=no --verbose --durations=10 "$testdir" +} + +if [ "$INFO" == "lint" ]; then + echo "running lint tests" + run_lint +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 |