Skip to content

Commit

Permalink
Fix fetching test package version for kubetest in helm-tester
Browse files Browse the repository at this point in the history
Signed-off-by: torredil <[email protected]>
  • Loading branch information
torredil committed Oct 31, 2024
1 parent 7089339 commit 4dbacc2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,23 @@ spec:
else
FOCUS_REGEX="${FOCUS_REGEX})"
fi
export KUBE_VERSION=$(kubectl version --output json | jq -r '.serverVersion.major + "." + .serverVersion.minor')
kubetest2 noop --run-id='e2e-kubernetes' --test=ginkgo -- --test-package-version="$(curl -L https://dl.k8s.io/release/stable-${KUBE_VERSION}.txt)" --skip-regex='[Disruptive]|[Serial]' --focus-regex="$FOCUS_REGEX" --parallel=25 --test-args='-storage.testdriver=/etc/config/manifests.yaml'
echo "Detecting Kubernetes server version"
export KUBE_VERSION=$(kubectl version --output json | jq -r '.serverVersion.major + "." + .serverVersion.minor' | sed 's/[^0-9.]*$//')
echo "Detected KUBE_VERSION=${KUBE_VERSION}"
echo "Fetching the stable test package version for KUBE_VERSION=${KUBE_VERSION}"
test_package_version=$(curl -L https://dl.k8s.io/release/stable-${KUBE_VERSION}.txt 2>/dev/null)
if echo "$test_package_version" | grep -q "Error"; then
echo "Error: Failed to fetch test package version for KUBE_VERSION=${KUBE_VERSION}. Exiting."
exit 1
fi
echo "Fetched test package version ${test_package_version}"
echo "Starting kubetest2 with ginkgo tests..."
kubetest2 noop --run-id='e2e-kubernetes' --test=ginkgo -- --test-package-version="$test_package_version" --skip-regex='[Disruptive]|[Serial]' --focus-regex="$FOCUS_REGEX" --parallel=25 --test-args='-storage.testdriver=/etc/config/manifests.yaml'
echo "kubetest2 test run completed."
volumeMounts:
- name: config-vol
mountPath: /etc/config
Expand Down

0 comments on commit 4dbacc2

Please sign in to comment.