[PATCH 2/2] .gitlab-ci.d: export meson testlog.txt as an artifact

Daniel P. Berrangé posted 2 patches 3 years, 9 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
[PATCH 2/2] .gitlab-ci.d: export meson testlog.txt as an artifact
Posted by Daniel P. Berrangé 3 years, 9 months ago
When running 'make check' we only get a summary of progress on the
console. Fortunately meson/ninja have saved the raw test output to a
logfile. Exposing this log will make it easier to debug failures that
happen in CI.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitlab-ci.d/buildtest-template.yml | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
index 2c7980a4f6..dc6d67aacf 100644
--- a/.gitlab-ci.d/buildtest-template.yml
+++ b/.gitlab-ci.d/buildtest-template.yml
@@ -26,7 +26,7 @@
         make -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
 
-.native_test_job_template:
+.common_test_job_template:
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
   script:
@@ -37,8 +37,16 @@
     # Avoid recompiling by hiding ninja with NINJA=":"
     - make NINJA=":" $MAKE_CHECK_ARGS
 
+.native_test_job_template:
+  extends: .common_test_job_template
+  artifacts:
+    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+    expire_in: 7 days
+    paths:
+      - build/meson-logs/testlog.txt
+
 .avocado_test_job_template:
-  extends: .native_test_job_template
+  extends: .common_test_job_template
   cache:
     key: "${CI_JOB_NAME}-cache"
     paths:
-- 
2.35.1


Re: [PATCH 2/2] .gitlab-ci.d: export meson testlog.txt as an artifact
Posted by Philippe Mathieu-Daudé via 3 years, 9 months ago
On 9/5/22 14:41, Daniel P. Berrangé wrote:
> When running 'make check' we only get a summary of progress on the
> console. Fortunately meson/ninja have saved the raw test output to a
> logfile. Exposing this log will make it easier to debug failures that
> happen in CI.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   .gitlab-ci.d/buildtest-template.yml | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Re: [PATCH 2/2] .gitlab-ci.d: export meson testlog.txt as an artifact
Posted by Thomas Huth 3 years, 9 months ago
On 09/05/2022 14.41, Daniel P. Berrangé wrote:
> When running 'make check' we only get a summary of progress on the
> console. Fortunately meson/ninja have saved the raw test output to a
> logfile. Exposing this log will make it easier to debug failures that
> happen in CI.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   .gitlab-ci.d/buildtest-template.yml | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
> index 2c7980a4f6..dc6d67aacf 100644
> --- a/.gitlab-ci.d/buildtest-template.yml
> +++ b/.gitlab-ci.d/buildtest-template.yml
> @@ -26,7 +26,7 @@
>           make -j"$JOBS" $MAKE_CHECK_ARGS ;
>         fi
>   
> -.native_test_job_template:
> +.common_test_job_template:
>     stage: test
>     image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
>     script:
> @@ -37,8 +37,16 @@
>       # Avoid recompiling by hiding ninja with NINJA=":"
>       - make NINJA=":" $MAKE_CHECK_ARGS
>   
> +.native_test_job_template:
> +  extends: .common_test_job_template
> +  artifacts:
> +    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
> +    expire_in: 7 days
> +    paths:
> +      - build/meson-logs/testlog.txt
> +
>   .avocado_test_job_template:
> -  extends: .native_test_job_template
> +  extends: .common_test_job_template
>     cache:
>       key: "${CI_JOB_NAME}-cache"
>       paths:

Reviewed-by: Thomas Huth <thuth@redhat.com>