Skip to content

Commit 9ef81b0

Browse files
committed
chore: make apidiff test more robust and informative
* Use exec so that if the prow job is killed, the script is killed too * Print full apidiff output in both success and failure cases
1 parent d858af0 commit 9ef81b0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

hack/verify-apidiff

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ apidiffs=$(go run github.com/joelanford/[email protected] ${APIDIFF_OLD_COMMIT}
3333
filtered=$(echo "$apidiffs" | grep -E 'cluster-api-provider-gcp/(api/|exp/api/)' || true)
3434

3535
if [[ -n "$filtered" ]]; then
36-
echo "API differences found in api/ or exp/api/:"
36+
echo "API differences found in api/ or exp/api/ packages."
37+
echo ""
38+
echo "Full set of differences found by go-apidiff:"
3739
echo "$apidiffs"
3840
exit 1
3941
else
40-
echo "No differences found in api/ or exp/api/ packages"
42+
echo "No differences found in api/ or exp/api/ packages."
43+
echo ""
44+
echo "Full set of differences found by go-apidiff:"
45+
echo "$apidiffs"
4146
fi

scripts/ci-apidiff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2222

2323
cd "${REPO_ROOT}"
2424

25-
APIDIFF_OLD_COMMIT="${PULL_BASE_SHA}" make apidiff
25+
APIDIFF_OLD_COMMIT="${PULL_BASE_SHA}" exec make apidiff

0 commit comments

Comments
 (0)