-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONAR-23677 Uses script to build dependencies
- Loading branch information
Showing
3 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
KUBE_VERSION="${KUBE_VERSION:-1.25.0}" | ||
STATIC_TEST_FOLDER='../../tests/unit-compatibility-test/'$(basename $PWD) | ||
PROJECT_ROOT=$(readlink -f "$(dirname "$0")"/..) | ||
CHART_NAME="${1:-$(basename "${PWD}")}" | ||
|
||
# NOTE: CHART_PATH is set to the first argument if it is provided, | ||
# otherwise it is set to "." (current dir) | ||
CHART_PATH="${1:+charts/$1}" | ||
CHART_PATH="${CHART_PATH:-.}" | ||
|
||
KUBE_VERSION="${KUBE_VERSION:-1.25.0}" | ||
STATIC_TEST_FOLDER="${PROJECT_ROOT}/tests/unit-compatibility-test/${CHART_NAME}" | ||
|
||
if ! [ -d "$STATIC_TEST_FOLDER" ]; then | ||
echo "$STATIC_TEST_FOLDER folder not found" | ||
if ! [[ -d "${STATIC_TEST_FOLDER}" ]]; then | ||
echo "${STATIC_TEST_FOLDER} folder not found" | ||
echo "you are probably not in the root of a chart" | ||
exit 1 | ||
fi | ||
|
||
echo 'Running unit compatibility tests for Kubernetes version' $KUBE_VERSION | ||
echo "Running unit compatibility tests for Kubernetes version ${KUBE_VERSION}" | ||
|
||
for file in "$STATIC_TEST_FOLDER"/*; do | ||
TEST_CASE_NAME=$(basename "$file") | ||
echo 'Entering test for' $TEST_CASE_NAME | ||
helm template --kube-version $KUBE_VERSION --dry-run --debug -f "$file" $TEST_CASE_NAME . | kubeconform --kubernetes-version $KUBE_VERSION --summary --strict -schema-location default -schema-location "../../tests/test-crds/{{.ResourceKind}}.json" | ||
echo 'Ending test for' $TEST_CASE_NAME | ||
done | ||
for file in "${STATIC_TEST_FOLDER}"/*; do | ||
TEST_CASE_NAME=$(basename "${file}") | ||
echo "Entering test for ${TEST_CASE_NAME}" | ||
helm template \ | ||
--kube-version "${KUBE_VERSION}" \ | ||
--dry-run \ | ||
--debug \ | ||
-f "${file}" "${TEST_CASE_NAME}" "${CHART_PATH}" \ | ||
| kubeconform \ | ||
--kubernetes-version "${KUBE_VERSION}" \ | ||
--summary \ | ||
--strict -schema-location default \ | ||
-schema-location "${PROJECT_ROOT}/tests/test-crds/{{.ResourceKind}}.json" | ||
echo "Ending test for ${TEST_CASE_NAME}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
gcloud 466.0.0 | ||
helm-ct 3.10.1 | ||
gcloud 470.0.0 | ||
helm-ct 3.10.1 | ||
kubeconform 0.6.3 |