Files
k3s/tests/e2e/scripts/latest_commit.sh
Derek Nola d07edd72f6 [Release-1.22] Backport E2E Testing Improvements (#5124)
* Fix cluster validation and add upgrade cluster test (#5020)

Signed-off-by: Shylaja Devadiga <shylaja@rancher.com>

Co-authored-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Migrate Ginkgo testing framework to V2, consolidate integration tests (#5097)

* Upgrade and convert ginkgo from v1 to v2
* Move all integration tests into integration folder
* Update TESTING.md

Signed-off-by: Derek Nola <derek.nola@suse.com>

* E2E Test Improvements (#5102)

* Fix infinite while loop on failure, reduce upgradecluster

* DRY code

Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-02-28 12:10:40 -08:00

15 lines
648 B
Bash
Executable File

#!/bin/bash
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
iterations=0
curl -s -H 'Accept: application/vnd.github.v3+json' "https://api.github.com/repos/k3s-io/k3s/commits?per_page=5&sha=$1" | jq -r '.[] | .sha' &> $2
curl -s --fail https://storage.googleapis.com/k3s-ci-builds/k3s-$(head -n 1 $2).sha256sum
while [ $? -ne 0 ]; do
((iterations++))
if [ "$iterations" -ge 6 ]; then
echo "No valid commits found"
exit 1
fi
sed -i 1d "$2"
sleep 1
curl -s --fail https://storage.googleapis.com/k3s-ci-builds/k3s-$(head -n 1 $2).sha256sum
done