Skip to content

Commit 7814796

Browse files
authored
Merge pull request #2516 from norio-nomura/ci-extend-upload-failure-logs
test.yml: expand the use of `upload_failure_logs_if_exists`.
2 parents 17ccd14 + bb724bf commit 7814796

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ jobs:
394394
retry_on: error
395395
max_attempts: 3
396396
command: ./hack/test-upgrade.sh ${{ matrix.oldver }} ${{ github.sha }}
397+
- if: always()
398+
uses: ./.github/actions/upload_failure_logs_if_exists
397399

398400
vz:
399401
name: "vz"

hack/test-templates.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ if [[ -n ${CHECKS["restart"]} ]]; then
334334

335335
export ftp_proxy=my.proxy:8021
336336
INFO "Restarting \"$NAME\""
337-
limactl start "$NAME"
337+
if ! limactl start "$NAME"; then
338+
ERROR "Failed to start \"$NAME\""
339+
diagnose "$NAME"
340+
exit 1
341+
fi
338342

339343
INFO "Make sure proxy setting is updated"
340344
got=$(limactl shell "$NAME" env | grep FTP_PROXY)
@@ -367,7 +371,11 @@ if [[ -n ${CHECKS["user-v2"]} ]]; then
367371
INFO "Testing user-v2 network"
368372
secondvm="$NAME-1"
369373
"${LIMACTL_CREATE[@]}" "$FILE" --name "$secondvm"
370-
limactl start "$secondvm"
374+
if ! limactl start "$secondvm"; then
375+
ERROR "Failed to start \"$secondvm\""
376+
diagnose "$secondvm"
377+
exit 1
378+
fi
371379
secondvmDNS="lima-$secondvm.internal"
372380
INFO "DNS of $secondvm is $secondvmDNS"
373381
set -x

hack/test-upgrade.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ function uninstall_lima() {
4949

5050
function show_lima_log() {
5151
tail -n 100 ~/.lima/"${LIMA_INSTANCE}"/*.log || true
52+
mkdir -p failure-logs
53+
cp -pf ~/.lima/"${LIMA_INSTANCE}"/*.log failure-logs/ || true
54+
limactl shell "${LIMA_INSTANCE}" sudo cat /var/log/cloud-init-output.log | tee failure-logs/cloud-init-output.log || true
5255
}
5356

5457
INFO "Uninstalling lima"
@@ -89,7 +92,7 @@ INFO "Installing the new Lima ${NEWVER}"
8992
install_lima "${NEWVER}"
9093

9194
INFO "Restarting the instance"
92-
limactl start --tty=false "${LIMA_INSTANCE}"
95+
limactl start --tty=false "${LIMA_INSTANCE}" || show_lima_log
9396
lima nerdctl info
9497

9598
INFO "Confirming that the host filesystem is still mounted"

0 commit comments

Comments
 (0)