ci: add folding markers to avoid getting output out of sections

Move commands to existing sections, or add markers for new sections when
no surrounding existing section is relevant. This is to avoid having
logs outside of subsection for the “vmtest” step of the GitHub action.
This commit is contained in:
Quentin Monnet
2021-11-30 00:16:31 +00:00
committed by Andrii Nakryiko
parent 1f7db672e4
commit 7cda69caeb
2 changed files with 12 additions and 8 deletions

View File

@@ -301,11 +301,11 @@ if [[ $SKIPIMG -eq 0 && ! -v ROOTFSVERSION ]]; then
ROOTFSVERSION="$(newest_rootfs_version)"
fi
travis_fold start vmlinux_setup "Preparing Linux image"
echo "Kernel release: $KERNELRELEASE" >&2
echo
travis_fold start vmlinux_setup "Preparing Linux image"
if (( SKIPIMG )); then
echo "Not extracting root filesystem" >&2
else
@@ -475,12 +475,17 @@ set -eux
echo 'Running setup commands'
${setup_envvars}
set +e; ${setup_cmd}; exitstatus=\$?; set -e
set +e
${setup_cmd}; exitstatus=\$?
echo -e '$(travis_fold start collect_status "Collect status")'
set -e
# If setup command did not write its exit status to /exitstatus, do it now
if [[ -s /exitstatus ]]; then
echo setup_cmd:\$exitstatus > /exitstatus
fi
chmod 644 /exitstatus
echo -e '$(travis_fold end collect_status)'
echo -e '$(travis_fold start shutdown Shutdown)'
HERE
fi
@@ -488,12 +493,9 @@ guestfish --remote \
upload "$tmp" /etc/rcS.d/S50-run-tests : \
chmod 755 /etc/rcS.d/S50-run-tests
fold_shutdown="$(travis_fold start shutdown Shutdown)"
cat <<HERE >"$tmp"
#!/bin/sh
echo -e '${fold_shutdown}'
poweroff
HERE
guestfish --remote \

View File

@@ -35,11 +35,13 @@ else
${VMTEST_ROOT}/prepare_selftests.sh
fi
travis_fold start adduser_to_kvm "Add user ${USER}"
sudo adduser "${USER}" kvm
travis_fold stop adduser_to_kvm
# Escape whitespace characters.
setup_cmd=$(sed 's/\([[:space:]]\)/\\\1/g' <<< "${VMTEST_SETUPCMD}")
sudo adduser "${USER}" kvm
if [[ "${KERNEL}" = 'LATEST' ]]; then
if [[ "$CHECKOUT_KERNEL" == "1" ]]; then
sudo -E sudo -E -u "${USER}" "${VMTEST_ROOT}/run.sh" -b travis-ci/vmtest/bpf-next -o -d ~ -s "${setup_cmd}" ~/root.img