ci: remove results directory content only with piglit runners
authorAndres Gomez <agomez@igalia.com>
Tue, 4 May 2021 19:10:54 +0000 (22:10 +0300)
committerMarge Bot <eric+marge@anholt.net>
Sat, 22 May 2021 06:26:28 +0000 (06:26 +0000)
Removing the directory itself can be problematic with certain runner
strategies (B2C).

v2:
  - Better deleting pattern matching since the previously used one was
    problematic and not pointed out by /bin/sh, as noticed by Emma.

v3:
  - Check that the results directory exists before attempting to
    delete its content.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856>

.gitlab-ci/piglit/run.sh
.gitlab-ci/piglit/run_cl.sh

index d98c562..5c21ef5 100755 (executable)
@@ -176,7 +176,9 @@ replay_minio_upload_images() {
 
 SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD | tee /tmp/version.txt | grep \"Mesa $MESA_VERSION\(\s\|$\)\""
 
-rm -rf results
+if [ -d results ]; then
+    cd results && rm -rf ..?* .[!.]* *
+fi
 cd /piglit
 
 if [ -n "$USE_CASELIST" ]; then
index 506fb31..a1f01bb 100755 (executable)
@@ -5,7 +5,9 @@ set -o xtrace
 
 VERSION=`cat install/VERSION`
 
-rm -rf results
+if [ -d results ]; then
+    cd results && rm -rf ..?* .[!.]* *
+fi
 cd /piglit
 
 export OCL_ICD_VENDORS=$OLDPWD/install/etc/OpenCL/vendors/