ci: Rework path handling

This patch cleans up the CI path handling, and
allows for external path variables to be used.

Environment variables are now respected for MESA_PATH,
VIRGL_PATH and CTS_PATH.

Additionally these variables can be picked up from a
config file `~/.virgl-ci.conf`

$ cat ~/.virgl-ci.conf
MESA_PATH=/opt/virgl/mesa
VIRGL_PATH=/opt/virgl/virglrenderer

Or given as a local environment variable like below.

CTS_PATH=/opt/virgl/ ci/run_test_suite.sh --piglit --gles3 --backend softpipe

Signed-off-by: Robert Foss <robert.foss@collabora.com>
macos/master
Robert Foss 6 years ago
parent 3dc64e50ef
commit a5e65fc6d3
No known key found for this signature in database
GPG Key ID: B79A0B6A11EEF727
  1. 16
      ci/run_ci_locally.sh
  2. 13
      ci/run_test_suite.sh

@ -1,8 +1,9 @@
#!/bin/bash
PROJECT_PATH="$(dirname $(readlink -f "$0"))/.."
# Setup paths and import util functions
. $(dirname $(readlink -f "$0"))/util.sh
cd ${PROJECT_PATH}
cd ${VIRGL_PATH}
DOCKER_DRIVER=overlay2
DOCKER_IMAGE=virglrenderer/ci
@ -15,21 +16,18 @@ NUM_THREADS=$(expr $(expr $(nproc) + 2) / 3)
# may introduce variabity.
RENDER_DEVICE=/dev/dri/renderD128
LOCAL_MESA_PATH="../$PROJECT_PATH/mesa"
LOCAL_VIRGL_PATH="${PROJECT_PATH}"
if test $NUM_THREADS -gt 0; then THREAD_CONFIG="-e NUM_THREADS=$NUM_THREADS"; fi
if test -e $RENDER_DEVICE; then RD_CONFIG="--device=$RENDER_DEVICE -e RENDER_DEVICE=$RENDER_DEVICE"; fi
if test -e $LOCAL_MESA_PATH; then LOCAL_MESA="-v $LOCAL_MESA_PATH:/local_mesa -e LOCAL_MESA=/local_mesa"; fi
if test -e $LOCAL_VIRGL_PATH; then LOCAL_VIRGL="-v $LOCAL_VIRGL_PATH:/virglrenderer -e LOCAL_VIRGL=/virglrenderer"; fi
if test -e $MESA_PATH; then LOCAL_MESA="-v $MESA_PATH:/local_mesa -e LOCAL_MESA=/local_mesa"; fi
if test -e $VIRGL_PATH; then LOCAL_VIRGL="-v $VIRGL_PATH:/virglrenderer -e LOCAL_VIRGL=/virglrenderer"; fi
echo THREAD_CONFIG=$THREAD_CONFIG
echo RD_CONFIG=$RD_CONFIG
echo LOCAL_MESA=$LOCAL_MESA
echo LOCAL_VIRGL=$LOCAL_VIRGL
rm -rf $PROJECT_PATH/results
mkdir -p $PROJECT_PATH/results
rm -rf $VIRGL_PATH/results
mkdir -p $VIRGL_PATH/results
time docker build -t $DOCKER_IMAGE -f ci/Dockerfile --cache-from $DOCKER_IMAGE:latest ci

@ -2,17 +2,8 @@
trap "{ rm -f $TMP_TEST_FILE; }" EXIT
CI_PATH=$(dirname $(readlink -f "$0"))
VIRGL_PATH="/virglrenderer"
if [ ! -d "$VIRGL_PATH" ]; then
VIRGL_PATH="${CI_PATH}/.."
fi
CTS_PATH="/VK-GL-CTS"
if [ ! -d "$CTS_PATH" ]; then
CTS_PATH="${CI_PATH}/../../VK-GL-CTS"
fi
# Setup paths and import util functions
. $(dirname $(readlink -f "$0"))/util.sh
TESTS=""
BACKENDS=""

Loading…
Cancel
Save