Skip to content

Commit

Permalink
chore: check FS gen in hack/update-codegen.sh (#2395)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek authored Jun 26, 2024
1 parent 64d73de commit 9f6a875
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set -o pipefail

source "$(go run knative.dev/hack/cmd/script library.sh)"

go generate "pkg/functions/templates_embedded.go"

POD_NAMESPACE=default KUBECONFIG="$(mktemp)" go run ${REPO_ROOT_DIR}/docs/generator/main.go

# Make sure our dependencies are up-to-date
Expand Down
8 changes: 7 additions & 1 deletion hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ trap "cleanup" EXIT SIGINT
# Save working tree state
cp -aR "${REPO_ROOT_DIR}/go.sum" "${TMP_DIFFROOT}"
cp -aR "${REPO_ROOT_DIR}/docs/" "${TMP_DIFFROOT}"
mkdir "${TMP_DIFFROOT}/generate/"
cp "generate/zz_filesystem_generated.go" "${TMP_DIFFROOT}/generate/"

ret=0
echo "Checking generated FS"
# Yes, this must be called before hack/update-codegen.sh
go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem || ret=1

"${REPO_ROOT_DIR}/hack/update-codegen.sh"
echo "Diffing ${REPO_ROOT_DIR} against freshly generated codegen"
ret=0
diff -Nupr --no-dereference "${REPO_ROOT_DIR}/go.sum" "${TMP_DIFFROOT}/go.sum" || ret=1
diff -Nupr --no-dereference "${REPO_ROOT_DIR}/docs/" "${TMP_DIFFROOT}/docs/" || ret=1

Expand Down

0 comments on commit 9f6a875

Please sign in to comment.