2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

tests: put logs from apt-get in a collapsed section

This is a small quality-of-life improvement when looking at CI/CD logs
on GitLab.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
This commit is contained in:
Zygmunt Krynicki 2025-01-21 17:46:04 +01:00
parent f01a40a77c
commit 29c618a11b

View File

@ -17,6 +17,7 @@ stages:
.ubuntu-common: .ubuntu-common:
before_script: before_script:
# Install build-dependencies by loading the package list from the ubuntu/debian cloud-init profile. # Install build-dependencies by loading the package list from the ubuntu/debian cloud-init profile.
- printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_deps "Installing dependencies..."
- apt-get update -qq - apt-get update -qq
- apt-get install --yes yq make lsb-release - apt-get install --yes yq make lsb-release
- | - |
@ -24,6 +25,7 @@ stages:
| make -f - nothing \ | make -f - nothing \
| yq '.packages | .[]' \ | yq '.packages | .[]' \
| xargs apt-get install --yes --no-install-recommends | xargs apt-get install --yes --no-install-recommends
- printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_deps
after_script: after_script:
# Inspect the kernel and lsb-release. # Inspect the kernel and lsb-release.
- lsb_release -a - lsb_release -a
@ -88,7 +90,9 @@ test-utils:
- make -C utils --touch - make -C utils --touch
# TODO: move those to cloud-init list? # TODO: move those to cloud-init list?
- printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_extra_deps "Installing additional dependencies..."
- apt-get install --no-install-recommends -y libc6-dev libjs-jquery libjs-jquery-throttle-debounce libjs-jquery-isonscreen libjs-jquery-tablesorter flake8 python3-coverage python3-notify2 python3-psutil python3-setuptools python3-tk python3-ttkthemes python3-gi - apt-get install --no-install-recommends -y libc6-dev libjs-jquery libjs-jquery-throttle-debounce libjs-jquery-isonscreen libjs-jquery-tablesorter flake8 python3-coverage python3-notify2 python3-psutil python3-setuptools python3-tk python3-ttkthemes python3-gi
- printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_extra_deps
# See apparmor/apparmor#221 # See apparmor/apparmor#221
- make -C parser/tst gen_dbus - make -C parser/tst gen_dbus
@ -130,7 +134,9 @@ test-build-regression:
- .ubuntu-common - .ubuntu-common
script: script:
# Additional dependencies required by regression tests # Additional dependencies required by regression tests
- printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_extra_deps "Installing additional dependencies..."
- apt-get install --no-install-recommends -y attr libdbus-1-dev liburing-dev - apt-get install --no-install-recommends -y attr libdbus-1-dev liburing-dev
- printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_extra_deps
- make -C tests/regression/apparmor -j $(nproc) - make -C tests/regression/apparmor -j $(nproc)
shellcheck: shellcheck:
@ -139,7 +145,9 @@ shellcheck:
extends: extends:
- .ubuntu-common - .ubuntu-common
script: script:
- printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_extra_deps "Installing additional dependencies..."
- apt-get install --no-install-recommends -y python3-minimal file shellcheck xmlstarlet - apt-get install --no-install-recommends -y python3-minimal file shellcheck xmlstarlet
- printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_extra_deps
- shellcheck --version - shellcheck --version
- './tests/bin/shellcheck-tree --format=checkstyle - './tests/bin/shellcheck-tree --format=checkstyle
| xmlstarlet tr tests/checkstyle2junit.xslt | xmlstarlet tr tests/checkstyle2junit.xslt
@ -170,7 +178,9 @@ coverity:
extends: extends:
- .ubuntu-common - .ubuntu-common
script: script:
- printf '\e[0K%s:%s:%s[collapsed=true]\r\e[0K%s\n' section_start "$(date +%s)" install_extra_deps "Installing additional dependencies..."
- apt-get install --no-install-recommends -y curl git texlive-latex-recommended - apt-get install --no-install-recommends -y curl git texlive-latex-recommended
- printf '\e[0K%s:%s:%s\r\e[0K\n' section_end "$(date +%s)" install_extra_deps
- curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 - curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
- tar xfz /tmp/cov-analysis-linux64.tgz - tar xfz /tmp/cov-analysis-linux64.tgz