gitlab-ci: Use xvfb-run
Change the CI scripts to use xvfb-run instead of running Xvfb directly. That avoids a potential race condition, where a test could fail because Xvfb hasn't started listening for connections yet. xvfb-run will wait for Xvfb to be ready before it runs any other programs. That also simplifies error handling, because the CI scripts can just use "set -e" instead of having to store the exit code, kill Xvfb, and then check for an error.
This commit is contained in:
parent
4852538bdb
commit
27251993ba
|
@ -11,12 +11,5 @@ cd build
|
||||||
|
|
||||||
make V=1 VERBOSE=1
|
make V=1 VERBOSE=1
|
||||||
|
|
||||||
Xvfb :99 &
|
xvfb-run --auto-servernum make check V=1 VERBOSE=1
|
||||||
|
|
||||||
set +e
|
|
||||||
DISPLAY=:99 make check V=1 VERBOSE=1
|
|
||||||
RESULT=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
kill %Xvfb
|
|
||||||
exit $RESULT
|
|
||||||
|
|
|
@ -9,17 +9,11 @@ mkdir build
|
||||||
cd build
|
cd build
|
||||||
../configure
|
../configure
|
||||||
|
|
||||||
Xvfb :99 &
|
xvfb-run --auto-servernum make distcheck V=1 VERBOSE=1
|
||||||
|
|
||||||
set +e
|
|
||||||
DISPLAY=:99 make distcheck V=1 VERBOSE=1
|
|
||||||
RESULT=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# If make distcheck failed don't even bother with the meson check, the tarball
|
# If make distcheck failed don't even bother with the meson check, the tarball
|
||||||
# may be invalid and it's just a waste
|
# may be invalid and it's just a waste
|
||||||
if [ $RESULT -ne 0 ]; then
|
if [ $RESULT -ne 0 ]; then
|
||||||
kill %Xvfb
|
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -32,11 +26,6 @@ mkdir libglvnd
|
||||||
tar -xf libglvnd-*.tar.gz -C libglvnd --strip-components 1
|
tar -xf libglvnd-*.tar.gz -C libglvnd --strip-components 1
|
||||||
pushd libglvnd
|
pushd libglvnd
|
||||||
meson builddir --auto-features=enabled
|
meson builddir --auto-features=enabled
|
||||||
set +e
|
xvfb-run --auto-servernum ninja -C builddir test
|
||||||
DISPLAY=:99 ninja -C builddir test
|
|
||||||
RESULT=$?
|
|
||||||
set -e
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
kill %Xvfb
|
|
||||||
exit $RESULT
|
|
||||||
|
|
|
@ -11,12 +11,4 @@ set -o xtrace
|
||||||
meson build --unity=on --auto-features=enabled $CONFIGURE_OPTIONS
|
meson build --unity=on --auto-features=enabled $CONFIGURE_OPTIONS
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
|
||||||
Xvfb :99 &
|
xvfb-run --auto-servernum ninja -C build test
|
||||||
|
|
||||||
set +e
|
|
||||||
DISPLAY=:99 ninja -C build test
|
|
||||||
RESULT=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
kill %Xvfb
|
|
||||||
exit $RESULT
|
|
||||||
|
|
Loading…
Reference in a new issue