Skip to contentSkip to conversation

gitlab-ci: include full Rust backtraces in test runs

PATCH In review Paolo Bonzini 5 participants 8 messages Jan 29, 2025 – Mar 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitlab-ci: include full Rust backtraces in test runs

---
 .gitlab-ci.d/buildtest-template.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +1 -0
index 39da7698b09..4cc19239319 100644
@@ -63,6 +63,7 @@
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
   script:
+    - export RUST_BACKTRACE=1
     - source scripts/ci/gitlab-ci-section
     - section_start buildenv "Setting up to run tests"
     - scripts/git-submodule.sh update roms/SLOF
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw

On 29/1/25 09:20, Paolo Bonzini wrote:

Stefan Hajnoczi <[email protected]>

Quoted 17 lines
---
  .gitlab-ci.d/buildtest-template.yml | 1 +
  1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +1 -0
index 39da7698b09..4cc19239319 100644
@@ -63,6 +63,7 @@
    stage: test
    image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
    script:
+    - export RUST_BACKTRACE=1
      - source scripts/ci/gitlab-ci-section
      - section_start buildenv "Setting up to run tests"
      - scripts/git-submodule.sh update roms/SLOF
Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 10 lines · Paolo Bonzini
---
  .gitlab-ci.d/buildtest-template.yml | 1 +
  1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +0 -0
index 39da7698b09..4cc19239319 100644

.gitlab-ci.d/buildtest-template.yml line 69

Quoted 7 lines
.gitlab-ci.d/buildtest-template.yml +1 -0
@@ -63,6 +63,7 @@
    stage: test
    image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
    script:
+    - export RUST_BACKTRACE=1
      - source scripts/ci/gitlab-ci-section
      - section_start buildenv "Setting up to run tests"
      - scripts/git-submodule.sh update roms/SLOF
#3 lore raw
In reply to Paolo Bonzini
Quoted 11 lines · Paolo Bonzini
---
 .gitlab-ci.d/buildtest-template.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +0 -0
index 39da7698b09..4cc19239319 100644

.gitlab-ci.d/buildtest-template.yml

Quoted 8 lines
.gitlab-ci.d/buildtest-template.yml +1 -1
@@ -63,6 +63,7 @@
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
   script:
+    - export RUST_BACKTRACE=1
     - source scripts/ci/gitlab-ci-section
     - section_start buildenv "Setting up to run tests"
     - scripts/git-submodule.sh update roms/SLOF
--

This will only add the rust backtraces when the tests are run from the CI logs, not when you locally run "make check" or similar. There's probably a better place to put this...

-- PMM

#4 lore raw
Quoted 17 lines · Peter Maydell
Quoted 16 lines · Paolo Bonzini
---
 .gitlab-ci.d/buildtest-template.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +1 -0
index 39da7698b09..4cc19239319 100644
@@ -63,6 +63,7 @@
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
   script:
+    - export RUST_BACKTRACE=1
     - source scripts/ci/gitlab-ci-section
Quoted 8 lines

.gitlab-ci.d/buildtest-template.yml

Quoted 3 lines
.gitlab-ci.d/buildtest-template.yml +0 -1
     - section_start buildenv "Setting up to run tests"
     - scripts/git-submodule.sh update roms/SLOF
--

This will only add the rust backtraces when the tests are run from the CI logs, not when you locally run "make check" or similar. There's probably a better place to put this...

Meson's 'test()' command accepts env variables, but it'll be somewhat tedious to add the same env to all case where we use test. Might want to define a common 'testenv' set at the top level meson.build and then reference it from every 'test()', unless meson has built-in support for globally applied env vars that I'm missing.

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 :|
#5 lore raw
Quoted 28 lines · Daniel P. Berrangé
Quoted 17 lines · Peter Maydell
Quoted 16 lines · Paolo Bonzini
---
 .gitlab-ci.d/buildtest-template.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +1 -0
index 39da7698b09..4cc19239319 100644
@@ -63,6 +63,7 @@
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
   script:
+    - export RUST_BACKTRACE=1
     - source scripts/ci/gitlab-ci-section
Quoted 8 lines

.gitlab-ci.d/buildtest-template.yml

Quoted 3 lines
.gitlab-ci.d/buildtest-template.yml +0 -1
     - section_start buildenv "Setting up to run tests"
     - scripts/git-submodule.sh update roms/SLOF
--

This will only add the rust backtraces when the tests are run from the CI logs, not when you locally run "make check" or similar. There's probably a better place to put this...

Quoted 5 lines

Meson's 'test()' command accepts env variables, but it'll be somewhat tedious to add the same env to all case where we use test. Might want to define a common 'testenv' set at the top level meson.build and then reference it from every 'test()', unless meson has built-in support for globally applied env vars that I'm missing.

Or we could set it in tests/Makefile.include :-)

-- PMM

#6 lore raw
In reply to Daniel P. Berrangé
Quoted 10 lines · Daniel P. Berrangé
Quoted 4 lines

This will only add the rust backtraces when the tests are run from the CI logs, not when you locally run "make check" or similar. There's probably a better place to put this...

Meson's 'test()' command accepts env variables, but it'll be somewhat tedious to add the same env to all case where we use test. Might want to define a common 'testenv' set at the top level meson.build and then reference it from every 'test()', unless meson has built-in support for globally applied env vars that I'm missing.

It can be added to add_test_setup().

Paolo

#7 lore raw
Quoted 7 lines · Paolo Bonzini
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines

This will only add the rust backtraces when the tests are run from the CI logs, not when you locally run "make check" or similar. There's probably a better place to put this...

Quoted 7 lines
Quoted 5 lines

Meson's 'test()' command accepts env variables, but it'll be somewhat tedious to add the same env to all case where we use test. Might want to define a common 'testenv' set at the top level meson.build and then reference it from every 'test()', unless meson has built-in support for globally applied env vars that I'm missing.

It can be added to add_test_setup().

Thanks -- I just sent a patch to do it that way:

https://patchew.org/QEMU/[email protected]/

-- PMM