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

View File

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