Skip to contentSkip to conversation

gitlab: misc artifact / log handling fixes

PATCH In review Daniel P. Berrangé 2 participants 11 messages Sep 8, 2025 – Sep 9, 2025

lore
Share & tools
lore
#0 lore raw

cover gitlab: misc artifact / log handling fixes

Daniel P. Berrangé (4):
gitlab: replace avocado results files with meson results files
gitlab: always include entire of meson-logs directory
gitlab: include all junit XML files from meson
gitlab: prevent duplicated meson log artifacts in test jobs

 .gitlab-ci.d/buildtest-template.yml  | 16 +++++++++++-----
 .gitlab-ci.d/buildtest.yml           |  4 ++--
 .gitlab-ci.d/crossbuild-template.yml |  4 ++--
 .gitlab-ci.d/custom-runners.yml      |  2 +-
 .gitlab-ci.d/windows.yml             |  4 ++--
 5 files changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.50.1
#1 lore raw

PATCH 1/4 gitlab: replace avocado results files with meson results files

The 'results.xml' file and 'test-results' directory were both outputs of the avovcado test runner. Since we're now using meson with the new functional test framework, we must reference meson results files as the CI artifacts.

---
 .gitlab-ci.d/buildtest-template.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
.gitlab-ci.d/buildtest-template.yml +2 -3
index 038c3c9540..4672298214 100644
@@ -104,11 +104,10 @@
     when: always
     expire_in: 7 days
     paths:
-      - build/tests/results/latest/results.xml
-      - build/tests/results/latest/test-results
+      - build/meson-logs/testlog.txt
       - build/tests/functional/*/*/*.log
     reports:
-      junit: build/tests/results/latest/results.xml
+      junit: build/meson-logs/testlog.junit.xml
   before_script:
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
Signature · 1 line
2.50.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] gitlab: replace avocado results files with meson results files

Quoted 6 lines · Daniel P. Berrangé

The 'results.xml' file and 'test-results' directory were both outputs of the avovcado test runner. Since we're now using meson with the new functional test framework, we must reference meson results files as the CI artifacts.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#3 lore raw

PATCH 2/4 gitlab: always include entire of meson-logs directory

In reply to Daniel P. Berrangé

There are files besides testlog.txt that may be useful as published CI artifacts.

---
 .gitlab-ci.d/buildtest-template.yml  | 4 ++--
 .gitlab-ci.d/buildtest.yml           | 2 +-
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 .gitlab-ci.d/windows.yml             | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
.gitlab-ci.d/buildtest-template.yml +2 -2
index 4672298214..4cc5b20790 100644
@@ -88,7 +88,7 @@
     when: always
     expire_in: 7 days
     paths:
-      - build/meson-logs/testlog.txt
+      - build/meson-logs
     reports:
       junit: build/meson-logs/testlog.junit.xml
 
@@ -104,7 +104,7 @@
     when: always
     expire_in: 7 days
     paths:
-      - build/meson-logs/testlog.txt
+      - build/meson-logs
       - build/tests/functional/*/*/*.log
     reports:
       junit: build/meson-logs/testlog.junit.xml
.gitlab-ci.d/buildtest.yml +1 -1
index d888a60063..778289267f 100644
@@ -613,7 +613,7 @@ gcov:
     when: always
     expire_in: 2 days
     paths:
-      - build/meson-logs/testlog.txt
+      - build/meson-logs
     reports:
       junit: build/meson-logs/testlog.junit.xml
       coverage_report:
.gitlab-ci.d/crossbuild-template.yml +1 -1
index 303943f818..7e70376cfc 100644
@@ -128,6 +128,6 @@
     when: always
     expire_in: 7 days
     paths:
-      - build/meson-logs/testlog.txt
+      - build/meson-logs
     reports:
       junit: build/meson-logs/testlog.junit.xml
.gitlab-ci.d/windows.yml +1 -1
index beac39e5bd..f14e9ca134 100644
@@ -24,7 +24,7 @@ msys2-64bit:
     name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     expire_in: 7 days
     paths:
-      - build/meson-logs/testlog.txt
+      - build/meson-logs
     reports:
       junit: "build/meson-logs/testlog.junit.xml"
   before_script:
Signature · 1 line
2.50.1
#5 lore raw

PATCH 3/4 gitlab: include all junit XML files from meson

In reply to Daniel P. Berrangé

The junit XML file produced by meson does not always have the name 'testlog.junit.xml' - in the case of 'make check-functional' there is a 'testlog-thorough.junit.xml' file too.

Improve CI debugging robustness by capturing all junit files that meson produces.

---
 .gitlab-ci.d/buildtest-template.yml  | 4 ++--
 .gitlab-ci.d/buildtest.yml           | 2 +-
 .gitlab-ci.d/crossbuild-template.yml | 2 +-
 .gitlab-ci.d/custom-runners.yml      | 2 +-
 .gitlab-ci.d/windows.yml             | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
.gitlab-ci.d/buildtest-template.yml +2 -2
index 4cc5b20790..308490a35a 100644
@@ -90,7 +90,7 @@
     paths:
       - build/meson-logs
     reports:
-      junit: build/meson-logs/testlog.junit.xml
+      junit: build/meson-logs/*.junit.xml
 
 .functional_test_job_template:
   extends: .common_test_job_template
@@ -107,7 +107,7 @@
       - build/meson-logs
       - build/tests/functional/*/*/*.log
     reports:
-      junit: build/meson-logs/testlog.junit.xml
+      junit: build/meson-logs/*.junit.xml
   before_script:
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
.gitlab-ci.d/buildtest.yml +1 -1
index 778289267f..83c2867295 100644
@@ -615,7 +615,7 @@ gcov:
     paths:
       - build/meson-logs
     reports:
-      junit: build/meson-logs/testlog.junit.xml
+      junit: build/meson-logs/*.junit.xml
       coverage_report:
         coverage_format: cobertura
         path: build/coverage.xml
.gitlab-ci.d/crossbuild-template.yml +1 -1
index 7e70376cfc..58136d06e4 100644
@@ -130,4 +130,4 @@
     paths:
       - build/meson-logs
     reports:
-      junit: build/meson-logs/testlog.junit.xml
+      junit: build/meson-logs/*.junit.xml
.gitlab-ci.d/custom-runners.yml +1 -1
index 1aa3c60efe..2d493f70f7 100644
@@ -26,7 +26,7 @@
       - build/build.ninja
       - build/meson-logs
     reports:
-      junit: build/meson-logs/testlog.junit.xml
+      junit: build/meson-logs/*.junit.xml
 
 include:
   - local: '/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml'
.gitlab-ci.d/windows.yml +1 -1
index f14e9ca134..1e6a01bd9a 100644
@@ -26,7 +26,7 @@ msys2-64bit:
     paths:
       - build/meson-logs
     reports:
-      junit: "build/meson-logs/testlog.junit.xml"
+      junit: build/meson-logs/*.junit.xml
   before_script:
   - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)"
   - If ( !(Test-Path -Path msys64\var\cache ) ) {
Signature · 1 line
2.50.1
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH 3/4] gitlab: include all junit XML files from meson

Quoted 8 lines · Daniel P. Berrangé

The junit XML file produced by meson does not always have the name 'testlog.junit.xml' - in the case of 'make check-functional' there is a 'testlog-thorough.junit.xml' file too.

Improve CI debugging robustness by capturing all junit files that meson produces.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#7 lore raw

PATCH 4/4 gitlab: prevent duplicated meson log artifacts in test jobs

In reply to Daniel P. Berrangé

The build jobs will populate build/meson-logs/ with various files that are added as artifacts.

The test jobs preserve the state of the build jobs, so we must delete any pre-existing logs to prevent confusion from duplicate artifacts.

---
 .gitlab-ci.d/buildtest-template.yml | 7 +++++++
 1 file changed, 7 insertions(+)
.gitlab-ci.d/buildtest-template.yml +7 -0
index 308490a35a..d866cb12bb 100644
@@ -83,6 +83,10 @@
 
 .native_test_job_template:
   extends: .common_test_job_template
+  before_script:
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   artifacts:
     name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     when: always
@@ -111,6 +115,9 @@
   before_script:
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   after_script:
     - cd build
     - du -chs ${CI_PROJECT_DIR}/*-cache
Signature · 1 line
2.50.1
#8 lore raw

Re: [PATCH 4/4] gitlab: prevent duplicated meson log artifacts in test jobs

Quoted 6 lines · Daniel P. Berrangé

The build jobs will populate build/meson-logs/ with various files that are added as artifacts.

The test jobs preserve the state of the build jobs, so we must delete any pre-existing logs to prevent confusion from duplicate artifacts.

Will this cause us to rebuild needlessly?

Quoted 31 lines
---
 .gitlab-ci.d/buildtest-template.yml | 7 +++++++
 1 file changed, 7 insertions(+)
.gitlab-ci.d/buildtest-template.yml +7 -0
index 308490a35a..d866cb12bb 100644
@@ -83,6 +83,10 @@
 
 .native_test_job_template:
   extends: .common_test_job_template
+  before_script:
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   artifacts:
     name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     when: always
@@ -111,6 +115,9 @@
   before_script:
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   after_script:
     - cd build
     - du -chs ${CI_PROJECT_DIR}/*-cache
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#9 lore raw

Re: [PATCH 4/4] gitlab: prevent duplicated meson log artifacts in test jobs

Quoted 10 lines · Alex Bennée
Quoted 6 lines · Daniel P. Berrangé

The build jobs will populate build/meson-logs/ with various files that are added as artifacts.

The test jobs preserve the state of the build jobs, so we must delete any pre-existing logs to prevent confusion from duplicate artifacts.

Will this cause us to rebuild needlessly?

These files aren't involved in any rebuild / stale checks & the test pipeline I ran show no difference in what was done.

Quoted 24 lines
Quoted 24 lines
---
 .gitlab-ci.d/buildtest-template.yml | 7 +++++++
 1 file changed, 7 insertions(+)
.gitlab-ci.d/buildtest-template.yml +4 -0
index 308490a35a..d866cb12bb 100644
@@ -83,6 +83,10 @@
 
 .native_test_job_template:
   extends: .common_test_job_template
+  before_script:
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   artifacts:
     name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     when: always
@@ -111,6 +115,9 @@
   before_script:
Quoted 13 lines
Quoted 8 lines
.gitlab-ci.d/buildtest-template.yml +3 -0
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
+    # Prevent logs from the build job that run earlier
+    # from being duplicated in the test job artifacts
+    - rm -f build/meson-logs/*
   after_script:
     - cd build
     - du -chs ${CI_PROJECT_DIR}/*-cache
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by Tested-by
#10 lore raw

Re: [PATCH 4/4] gitlab: prevent duplicated meson log artifacts in test jobs

Quoted 6 lines · Daniel P. Berrangé
Quoted 5 lines · Alex Bennée
Quoted 3 lines · Daniel P. Berrangé

The build jobs will populate build/meson-logs/ with various files that are added as artifacts.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

The test jobs preserve the state of the build jobs, so we must delete any pre-existing logs to prevent confusion from duplicate artifacts.

Will this cause us to rebuild needlessly?

These files aren't involved in any rebuild / stale checks & the test pipeline I ran show no difference in what was done.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro