diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4f9e63a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hack/test/charts"] + path = hack/test/charts + url = https://github.com/Kong/charts diff --git a/hack/test/charts b/hack/test/charts new file mode 160000 index 0000000..e09fd7a --- /dev/null +++ b/hack/test/charts @@ -0,0 +1 @@ +Subproject commit e09fd7a54ba99466328ccf9a581e50a3d516f58c diff --git a/hack/test/test-kong-chart.sh b/hack/test/test-kong-chart.sh new file mode 100644 index 0000000..9a1467a --- /dev/null +++ b/hack/test/test-kong-chart.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Update submodule to the latest commit +git submodule update --init --recursive + +# Loop through each directory in charts/charts and run helm dependency update +for dir in charts/charts/*; do + if [ -d "$dir" ]; then + cd "$dir" + helm dependency update + cd - + fi +done + +# Run make test.golden and check return code +make -C charts/ test.golden +if [ $? -eq 0 ]; then + echo "Tests passed successfully."; exit 0 +else + echo "Tests failed."; exit 1 +fi \ No newline at end of file