From 794e9500ade66d4243af14c1c3cd2bcdf55d42a1 Mon Sep 17 00:00:00 2001
From: Sam Kagan <skagan@nrao.edu>
Date: Wed, 8 May 2024 17:54:57 -0600
Subject: [PATCH] Drafted fix for reports not being found

---
 ci/package-build.template.yml | 6 ++++--
 ci/unit-test.template.yml     | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ci/package-build.template.yml b/ci/package-build.template.yml
index 0aef00539..d5396d82e 100644
--- a/ci/package-build.template.yml
+++ b/ci/package-build.template.yml
@@ -7,6 +7,7 @@
         - echo building package in $PACKAGE_PATH
         - export CAPO_PATH=$PWD
         - export CAPO_PROFILE=docker
+        - export PACKAGE_NAME=$(basename $PACKAGE_PATH)
         - WD=$PWD
         - cd ${PACKAGE_PATH}
 
@@ -22,6 +23,7 @@
         # Install the packages for testing
         - poetry install --with test
         - $(poetry env info -p)/bin/pytest --junitxml=tests.xml .
+        - mv ./tests.xml ${CI_PROJECT_DIR}/tests.${PACKAGE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
 
         # once tests pass, look to see if there is a conflicting version in pypi registry
         - PACKAGE_NAME=$(basename $PWD)
@@ -49,10 +51,10 @@
         - cd $WD
     artifacts:
         paths:
-            - tests.xml
+            - ${CI_PROJECT_DIR}/tests.${PACKAGE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
         reports:
           junit:
-            - tests.xml
+            - ${CI_PROJECT_DIR}/tests.${PACKAGE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
     rules:
         - changes:
             - ${PACKAGE_PATH}/**/*
diff --git a/ci/unit-test.template.yml b/ci/unit-test.template.yml
index 2fdaee17f..d40da49f7 100644
--- a/ci/unit-test.template.yml
+++ b/ci/unit-test.template.yml
@@ -9,13 +9,14 @@
         - poetry install --with test
         - $(poetry env info -p)/bin/pytest --junitxml=tests.xml --cov=${SERVICE_NAME} --cov-report=
         - mv ./.coverage ${CI_PROJECT_DIR}/.coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
+        - mv ./tests.xml ${CI_PROJECT_DIR}/tests.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
     artifacts:
         paths:
             - .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
-            - tests.xml
+            - ${CI_PROJECT_DIR}/tests.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
         reports:
           junit:
-            - tests.xml
+            - ${CI_PROJECT_DIR}/tests.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}.xml
     rules:
         - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9](\.[0-9])*)-DEVELOPMENT/'
           variables:
-- 
GitLab