Skip to contentSkip to conversation

CI: add KAS_BUILD_DIR variable

PATCH Applied Ross Burton 2 participants 4 messages Sep 27, 2024 – Sep 30, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 CI: add KAS_BUILD_DIR variable

Instead of always using KAS_WORK_DIR/build to refer to the build tree, on the assumption that is where the build tree is, export KAS_BUILD_DIR and use that variable instead.

---
 .gitlab-ci.yml | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
.gitlab-ci.yml +6 -5
index e8627731..bca957fe 100644
@@ -34,13 +34,14 @@ stages:
   interruptible: true
   variables:
     KAS_WORK_DIR: $CI_PROJECT_DIR/work
+    KAS_BUILD_DIR: $KAS_WORK_DIR/build
     KAS_REPO_REF_DIR: $CACHE_DIR/repos
     SSTATE_DIR: $CACHE_DIR/sstate
     DL_DIR: $CACHE_DIR/downloads
     BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
     TOOLCHAIN_DIR: $CACHE_DIR/toolchains
-    IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
-    TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
+    IMAGE_DIR: $KAS_BUILD_DIR/tmp/deploy/images
+    TOOLCHAIN_LINK_DIR: $KAS_BUILD_DIR/toolchains
   before_script:
     - echo KAS_WORK_DIR = $KAS_WORK_DIR
     - echo SSTATE_DIR = $SSTATE_DIR
@@ -75,13 +76,13 @@ stages:
     - echo KASFILES=$KASFILES
     - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
     - kas build $KASFILES
-    - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
+    - ./ci/check-warnings $KAS_BUILD_DIR/warnings.log
   artifacts:
     name: "logs"
     when: always
     paths:
-      - $CI_PROJECT_DIR/work/build/tmp*/work*/**/temp/log.do_*.*
-      - $CI_PROJECT_DIR/work/build/tmp*/work*/**/testimage/*
+      - $KAS_BUILD_DIR/tmp*/work*/**/temp/log.do_*.*
+      - $KAS_BUILD_DIR/tmp*/work*/**/testimage/*
 
 #
 # Prep stage, update repositories once.
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 CI: remove duplicate arm-systemready-ir-acs

We had two instances of the same job, so consolidate them into one.

---
 .gitlab-ci.yml | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
.gitlab-ci.yml +1 -14
index bca957fe..01f3539f 100644
@@ -130,7 +130,7 @@ arm-systemready-ir-acs:
       # arm-systemready-ir-acs must be specified after fvp-base for ordering
       # purposes for the jobs-to-kas output. It is not enough to just have it
       # in the job name because fvp-base.yml overwrites the target.
-      - PLATFORM: fvp-base
+      - PLATFORM: [fvp-base, corstone1000-fvp]
         ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
   tags:
     - ${ACS_TAG}
@@ -197,19 +197,6 @@ fvp-base:
         TESTING: testimage
       - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
 
-arm-systemready-ir-acs:
-  extends: .build
-  timeout: 12h
-  parallel:
-    matrix:
-      # arm-systemready-ir-acs must be specified after fvp-base for ordering
-      # purposes for the jobs-to-kas output. It is not enough to just have it
-      # in the job name because fvp-base.yml overwrites the target.
-      - PLATFORM: [fvp-base, corstone1000-fvp]
-        ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
-  tags:
-    - ${ACS_TAG}
-
 fvps:
   extends: .build
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 CI: transform testimage reports into JUnit XML reports

In reply to Ross Burton

Using resulttool we can transform the oeqa JSON reports into JUnit XML, which GitLab can display in pipelines and merge requests.

---
 .gitlab-ci.yml |  4 ++++
 ci/junit.sh    | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100755 ci/junit.sh
.gitlab-ci.yml +4 -0
index 01f3539f..e37f9d20 100644
@@ -77,12 +77,16 @@ stages:
     - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
     - kas build $KASFILES
     - ./ci/check-warnings $KAS_BUILD_DIR/warnings.log
+    - kas shell ci/base.yml:lockfile.yml --command "$CI_PROJECT_DIR/ci/junit.sh $KAS_WORK_DIR/build"
+
   artifacts:
     name: "logs"
     when: always
     paths:
       - $KAS_BUILD_DIR/tmp*/work*/**/temp/log.do_*.*
       - $KAS_BUILD_DIR/tmp*/work*/**/testimage/*
+    reports:
+      junit: $KAS_BUILD_DIR/tmp/log/oeqa/junit.xml
 
 #
 # Prep stage, update repositories once.
ci/junit.sh new file +15 -0
new file mode 100755
index 00000000..6262c34b
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+# $ ci/junit.sh <build directory>
+#
+# If there is a OEQA test report in JSON format present in the build directory,
+# transform it to JUnit XML using resulttool.
+
+set -e -u
+
+BUILDDIR=$1
+JSON=$BUILDDIR/tmp/log/oeqa/testresults.json
+
+if test -f $JSON; then
+    resulttool junit $JSON
+fi
Signature · 1 line
2.34.1
Applied
#3 lore raw
In reply to Ross Burton
Quoted 5 lines · Ross Burton

Instead of always using KAS_WORK_DIR/build to refer to the build tree, on the assumption that is where the build tree is, export KAS_BUILD_DIR and use that variable instead.

Applied, thanks!

[1/3] CI: add KAS_BUILD_DIR variable

      commit: d96bebfdedad3a374d61c6979b68b8b2da4b0d87
[2/3] CI: remove duplicate arm-systemready-ir-acs
      commit: 8696545747028c51b76e1921478987a790168165
[3/3] CI: transform testimage reports into JUnit XML reports
      commit: f22852b3531ac33476e93fe8a3c9c0111866b06d

Best regards,

Signature · 1 line
Jon Mason <[email protected]>