--- a/bitbucket-pipelines.yml Sat Sep 16 21:24:22 2017 +0300
+++ b/bitbucket-pipelines.yml Sat Sep 16 21:26:17 2017 +0300
@@ -7,16 +7,13 @@
script: # Modify the commands below to build your repository.
- /usr/bin/python --version
- ./tests/tools/check_source.sh
- - Xvfb :42 -screen 0 1280x1024x24 &
- - DISPLAY=:42 pytest --timeout=10 ./tests/tools
- - pkill -9 Xvfb
+ - ./tests/tools/run_python_tests.sh
+
default:
- step:
script: # Modify the commands below to build your repository.
- /usr/bin/python --version
- - ./tests/tools/check_source.sh
- - Xvfb :42 -screen 0 1280x1024x24 &
- - DISPLAY=:42 pytest --timeout=10 ./tests/tools
- - pkill -9 Xvfb
+ - ./tests/tools/check_source.sh
+ - ./tests/tools/run_python_tests.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/tools/run_python_tests.sh Sat Sep 16 21:26:17 2017 +0300
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+
+export DISPLAY=:42
+Xvfb $DISPLAY -screen 0 1280x1024x24 &
+sleep 1
+
+ret=0
+DELAY=400
+KILL_DELAY=$(($DELAY + 30))
+timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools
+ret=$?
+
+pkill -9 Xvfb
+
+exit $ret