From f78053065f6a671b6803d47af1e1c15b0eef1c30 Mon Sep 17 00:00:00 2001
From: Teake Nutma <t.a.nutma@rug.nl>
Date: Mon, 20 Jun 2022 17:46:02 +0200
Subject: [PATCH] Let curl fail explicitly when there's no previous test report

---
 templates/testreport/diff.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/testreport/diff.yml b/templates/testreport/diff.yml
index b23b71c..06de734 100644
--- a/templates/testreport/diff.yml
+++ b/templates/testreport/diff.yml
@@ -26,7 +26,7 @@
     # Download the report of the previous pipeline.
     # Can't use python-gitlab for that yet, see https://github.com/python-gitlab/python-gitlab/issues/1926.
     - TEST_REPORT_ARTIFACT_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$LAST_JOB/artifacts/$TEST_REPORT_ARTIFACT_FILE"
-    - 'curl --output "$TEST_REPORT_ARTIFACT_FILE.old" --location --header "JOB-TOKEN: $CI_JOB_TOKEN" "$TEST_REPORT_ARTIFACT_URL"'
+    - 'curl --fail --output "$TEST_REPORT_ARTIFACT_FILE.old" --location --header "JOB-TOKEN: $CI_JOB_TOKEN" "$TEST_REPORT_ARTIFACT_URL"'
     # Compare it to the report of this pipeline.
     - report_diff "$TEST_REPORT_ARTIFACT_FILE.old" "$TEST_REPORT_ARTIFACT_FILE" report_diff.xml
     - junitparser verify report_diff.xml
-- 
GitLab