From bcbd3452cfc84e4345c14ca0445454915976b9af Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Thu, 2 Jan 2025 18:22:04 +0100
Subject: [PATCH] Only fetch junit xml if it exists

---
 test/integration-test.yml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/integration-test.yml b/test/integration-test.yml
index bff929ae..11878109 100644
--- a/test/integration-test.yml
+++ b/test/integration-test.yml
@@ -22,16 +22,22 @@
     - name: Run tests
       command: "podman run --rm --network host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml --mount type=bind,source=/artifacts,destination=/artifacts {{ test_image }}"
 
+    - stat:
+        path: "/artifacts/pytest.xml"
+      register: pytest_xml_stat
+
     - name: Retrieve test result
       slurp:
         src: "/artifacts/pytest.xml"
       register: pytest_xml
+      when: "pytest_xml_stat and pytest_xml_stat.exists"
 
     - name: Store test results locally
       local_action:
         module: copy
         dest: "pytest.xml"
         content: "{{ pytest_xml['content'] | b64decode }}"
+      when: "pytest_xml_stat and pytest_xml_stat.exists"
 
   vars:
     test_image: "registry.git.autistici.org/ai3/float:integration-test"
-- 
GitLab