From 1b7aea43beb793fc36488364d650799529f8dff8 Mon Sep 17 00:00:00 2001
From: Antoine Merle <antoine.merle@epfl.ch>
Date: Thu, 25 Aug 2022 14:44:54 +0000
Subject: [PATCH] Use new template for MATLAB tests

---
 .gitlab-ci.yml          | 29 +++--------------------------
 matlab/run_gdat_tests.m |  2 +-
 2 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a1015713..24877d89 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,6 +7,7 @@ variables:
   TBXFOLDER: matlab
   MATFIRST: 902
   MATVER: 906
+  TESTCASE: tcv
 
 # no build for gdat, so don't define jobs for build phase
 
@@ -15,44 +16,23 @@ TCV-960:
   extends: .test-template
   variables:
     MATLABCMD: matlab960
-    TESTCASE: tcv
-  artifacts:
-   paths:
-    - test_${TBXTARGET}_${TESTCASE}_2019a_cov.xml
-   reports:
-    junit: test_${TBXTARGET}_${TESTCASE}_2019a.xml
-    cobertura: test_${TBXTARGET}_${TESTCASE}_2019a_cov.xml
 
 TCV_IMAS-960:
   extends: .test-template
   variables:
     MATLABCMD: matlab960
     TESTCASE: tcv_imas
-  artifacts:
-   paths:
-    - test_${TBXTARGET}_${TESTCASE}_2019a_cov.xml
-   reports:
-    junit: test_${TBXTARGET}_${TESTCASE}_2019a.xml
-    cobertura: test_${TBXTARGET}_${TESTCASE}_2019a_cov.xml
 
 TCV-920:
-  extends: .test-template
+  extends: .test-template:8.6-to-9.5
   variables:
     MATLABCMD: matlab920
-    TESTCASE: tcv
-  artifacts:
-   reports:
-    junit: test_${TBXTARGET}_${TESTCASE}_2017a.xml
-
 
 TCV_IMAS-920:
-  extends: .test-template
+  extends: .test-template:8.6-to-9.5
   variables:
     MATLABCMD: matlab920
     TESTCASE: tcv_imas
-  artifacts:
-   reports:
-    junit: test_${TBXTARGET}_${TESTCASE}_2017a.xml
 
 # Post test report collection
 code-coverage-960:
@@ -73,7 +53,6 @@ test-staging-960_tcv:
  extends: .test-staging-template
  variables:
   MATLABCMD: matlab960
-  TESTCASE: tcv
 
 test-staging-960_tcv_imas:
  extends: .test-staging-template
@@ -85,7 +64,6 @@ test-staging-920:
  extends: .test-staging-template
  variables:
   MATLABCMD: matlab920
-  TESTCASE: tcv
 
 # pre-deployment
 pre-deployment-checks:
@@ -100,7 +78,6 @@ test-post-deploy-matlab-9.2.0_tcv:
   extends: .test-post-deploy-template
   variables:
     MATLABCMD: matlab920
-    TESTCASE: tcv
 
 test-post-deploy-matlab-9.2.0_tcv_imas:
   extends: .test-post-deploy-template
diff --git a/matlab/run_gdat_tests.m b/matlab/run_gdat_tests.m
index b29021ad..5311ed65 100644
--- a/matlab/run_gdat_tests.m
+++ b/matlab/run_gdat_tests.m
@@ -88,7 +88,7 @@ if needXML || needCOV
 end
 if needXML
   % Add some JUnit XML file with tests results
-  xmlFile = fullfile(projectpath,sprintf('%s_%s_%s.xml',prefix,test_case,suffix));
+  xmlFile = fullfile(projectpath,sprintf('%s_%s_%s_junit.xml',prefix,test_case,suffix));
   fprintf('\tGenerating JUnit XML report at %s\n',xmlFile);
   p = XMLPlugin.producingJUnitFormat(xmlFile);
   runner.addPlugin(p)
-- 
GitLab