tests/tools/run_python_tests.sh
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 25 Oct 2017 13:50:26 +0300
changeset 1881 091005ec69c4
parent 1825 bcb50e736a46
child 2435 925adaa2cd5c
permissions -rwxr-xr-x
fix pylint py3k conversion warning: "(no-absolute-import) import missing `from __future__ import absolute_import`"
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