tracie: Make tests independent of environment
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Thu, 3 Sep 2020 11:22:40 +0000 (14:22 +0300)
committerAlexandros Frantzis <alexandros.frantzis@collabora.com>
Tue, 8 Sep 2020 07:43:07 +0000 (10:43 +0300)
Provide some sensible values for required environment variables to allow
tests to run properly in any environment.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6598>

.gitlab-ci/tracie-runner-gl.sh
.gitlab-ci/tracie/tests/test.py

index da4ce39..418dd3d 100755 (executable)
@@ -33,7 +33,7 @@ mkdir -p $RESULTS
 
 # Perform a self-test to ensure tracie is working properly.
 if [ -z "$TRACIE_NO_UNIT_TESTS" ]; then
-    TRACIE_UPLOAD_TO_MINIO=0 python3 -m pytest -v --pyargs $INSTALL/tracie/tests/test.py
+    python3 -m pytest -v --pyargs $INSTALL/tracie/tests/test.py
 fi
 
 if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
index 21264cc..ff4780c 100644 (file)
@@ -58,7 +58,10 @@ def prepare_for_run(tmp_path):
     shutil.move("./tests/test-data", "./traces-db")
     # Disable trace storing
     environ["TRACIE_STORE_IMAGES"] = "0"
-
+    environ["TRACIE_UPLOAD_TO_MINIO"] = "0"
+    environ["CI_PROJECT_PATH"] = "test-project"
+    environ["CI_PIPELINE_ID"] = "667"
+    environ["CI_JOB_ID"] = "42"
 
 def cleanup(tmp_path):
     '''