Commit 2535ae92 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED (tentative) run one XVFB server on which all tests are done

This is to try avoid some random "QXcbConnection: Could not connect to display :99" error
(that seems to occur especially during nightly build...)
parent 5b496339
......@@ -9,7 +9,7 @@ if ! grep -q TRIGGER_STAGE_BUILD "${PROJECT_LOG_DIR}/trigger-stage.txt"; then
exit 1;
fi
echo "Build"
echo "===== build ====="
if [ "$OS" == "win7" ]; then
# there is no xvfb on windows
......
......@@ -9,7 +9,7 @@ if ! grep -q TRIGGER_STAGE_CONFIGURE "${PROJECT_LOG_DIR}/trigger-stage.txt"; the
exit 1;
fi
echo "Configure step"
echo "===== configure ====="
# Clean build directory
# note: cannot build outside the source tree otherwise artifacts cannot be collected
......
......@@ -7,7 +7,7 @@ if ! grep -q TRIGGER_STAGE_COVERAGE "${PROJECT_LOG_DIR}/trigger-stage.txt"; then
exit 1;
fi
echo "Coverage"
echo "===== coverage ====="
# coverage for some reason seems to always exit with non-zero code. Force exit 0
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
......
......@@ -9,34 +9,35 @@ if ! grep -q TRIGGER_STAGE_TEST "${PROJECT_LOG_DIR}/trigger-stage.txt"; then
exit 1;
fi
echo "Test"
if [ "$OS" == "win7" ]; then
# there is no xvfb on windows
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
-DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \
-DCI_BRANCH="$CI_COMMIT_REF_NAME" \
-DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \
-DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1
else
# on Linux, xvfb is required to run the tests
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
-DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \
-DCI_BRANCH="$CI_COMMIT_REF_NAME" \
-DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \
-DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1
echo "===== test ====="
if [[ "$osName" != "win7" ]]; then
echo "===== Configuring xvfb ====="
# Starts the server first (try to avoid unexpected and random "QXcbConnection: Could not connect to display :99")
# see also https://doc.qt.io/qt-5/embedded-linux.html#linuxfb
Xvfb :5 -screen 0 1600x1200x24 -ac +extension GLX +render -noreset -v -fbdir $workingDir/ &
xvfbPid=$!
echo "PID of Xvfb: $xvfbPid"
export DISPLAY=:5
export XAUTHORITY=/dev/null
fi
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
-DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \
-DCI_BRANCH="$CI_COMMIT_REF_NAME" \
-DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \
-DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1
if [[ "$OS" != "win7" ]]; then
# shutdown xvfb
kill $xvfbPid
fi
# as ctest return a strange 255 error, check the log
......
......@@ -24,10 +24,10 @@ set -e
cleanup() {
# backup the current exit status
currentExitValue=$?
if [[ "$osName" != "Windows" ]]; then
# kill the xfvb
kill $xvfbPid
fi
if [[ "$osName" != "Windows" ]]; then
# kill the xfvb
kill $xvfbPid
fi
# cleanup current dir (but not build dir!)
if [ "$inBuild" == "0" ] ; then
rm -rf $workingDir
......@@ -89,12 +89,12 @@ fi
echo "===== Checking $camitkConfig ====="
# check if current build is on windows debug version
if ! hash -lt ${camitkConfig} 2>/dev/null; then
echo "===== Not found: $camitkConfig on $osName ====="
if [[ "$osName" == "Windows" ]]; then
echo "===== camitk-config binary not found, using Debug version on Windows ====="
# try with debug postfix
camitkConfig=$camitkConfig-debug
fi
echo "===== Not found: $camitkConfig on $osName ====="
if [[ "$osName" == "Windows" ]]; then
echo "===== camitk-config binary not found, using Debug version on Windows ====="
# try with debug postfix
camitkConfig=$camitkConfig-debug
fi
fi
echo "===== Get CamiTK configuration ====="
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment