From 3fe533890b585e03aa9ce456d37512f374076d54 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Sun, 8 Dec 2024 10:26:45 -0500 Subject: [PATCH] deploy: improve artifact upload The changes in this CL improve the uploading of build artifacts in deploy.yaml. Astonishingly, Cloud Build does not upload artifacts if the build fails. (The feature request is about five years old: https://issuetracker.google.com/issues/143836671). This makes it impossible to debug failed screentests. The hacky solution is to cause failed build steps to succeed. The -neverfail flag to screentest.sh accomplishes this. It isn't used in this CL, but a subsequent CL with more debugging support will use it. When the build does succeed, the directory of failed screentests does not exist, which causes artifact upload to fail. So create the directories along with dummy files. The wildcard syntax for Cloud Build artifact paths does not support '**' as documented, so provide all upload paths. Change-Id: I1c4223f4a906836000e5deac20a5b9aa920fbb97 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/634556 Commit-Queue: Jonathan Amsterdam Reviewed-by: Robert Findley TryBot-Bypass: Jonathan Amsterdam --- deploy/deploy.yaml | 4 +++- deploy/screentest.sh | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index e63399c59..309101bf4 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -95,4 +95,6 @@ steps: artifacts: objects: location: 'gs://$PROJECT_ID/screentest-artifacts' - paths: ['tests/screentest/output/**'] + paths: + - 'tests/screentest/output/*' + - 'tests/screentest/output/testcases/*' diff --git a/deploy/screentest.sh b/deploy/screentest.sh index 47421e82c..fd003d0be 100755 --- a/deploy/screentest.sh +++ b/deploy/screentest.sh @@ -10,23 +10,48 @@ source private/devtools/lib.sh || { echo "Are you at repo root?"; exit 1; } usage() { >&2 cat <