diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 28b853657cdf41d0f0a6931d2786f2ec57b642e9_LmdpdGxhYi1jaS55bWw=..48575d96fe199cf8dd359efc99e000c04f57ce9e_LmdpdGxhYi1jaS55bWw= 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,5 +17,5 @@
     - adduser -D test
     - chown -R test *
     - su test -c contrib/ci.sh
-  artifacts:
+  artifacts: &test-artifacts
     reports:
@@ -21,5 +21,5 @@
     reports:
-      junit: tests-$PYTHON-$HG.xml
+      junit: tests-$CI_JOB_ID.xml
 
 # First, test with the latest and greatest Mercurial, across the
 # versions Python supported. We generally assume that if e.g. CPython
@@ -81,10 +81,8 @@
         pyflakes3
       - >
         python3 tests/run-tests.py -v
-        --xunit $PWD/tests-ubuntu.xml --color=always --timeout 300
-    artifacts:
-      reports:
-        junit: tests-ubuntu.xml
+        --xunit $PWD/tests-$CI_JOB_ID.xml --color=always --timeout 300
+    artifacts: *test-artifacts
 
 # Test that the tests pass against the current branches
 Development:
diff --git a/contrib/ci.sh b/contrib/ci.sh
index 28b853657cdf41d0f0a6931d2786f2ec57b642e9_Y29udHJpYi9jaS5zaA==..48575d96fe199cf8dd359efc99e000c04f57ce9e_Y29udHJpYi9jaS5zaA== 100755
--- a/contrib/ci.sh
+++ b/contrib/ci.sh
@@ -4,4 +4,4 @@
 
 exec python$PYTHON tests/run-tests.py \
      --verbose --color=always --timeout 300 \
-     --xunit $PWD/tests-$PYTHON-$HG.xml
+     --xunit $PWD/tests-$CI_JOB_ID.xml