tests/tools/run_python_tests.sh
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 22 Sep 2017 10:52:44 +0300
changeset 1825 bcb50e736a46
parent 1820 76f5eba31afd
child 2435 925adaa2cd5c
permissions -rwxr-xr-x
run python tests with non-english locale to catch bugs related to localization
1820
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     2
1825
bcb50e736a46 run python tests with non-english locale to catch bugs related to localization
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1820
diff changeset
     3
LC_ALL=ru_RU.utf-8
1820
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     4
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     5
export DISPLAY=:42
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     6
Xvfb $DISPLAY -screen 0 1280x1024x24 &
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     7
sleep 1
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     8
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
     9
ret=0
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    10
DELAY=400
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    11
KILL_DELAY=$(($DELAY + 30))
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    12
timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    13
ret=$?
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    14
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    15
pkill -9 Xvfb
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    16
76f5eba31afd add shell script to run all python tests and automatically handle Xvfb
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
diff changeset
    17
exit $ret