Skip to content

Commit

Permalink
Update CI tests
Browse files Browse the repository at this point in the history
Bump k3s to v1.29.4+k3s1, and add basic sig-api-machinery e2e against sqlite

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed May 8, 2024
1 parent 17116c5 commit 7c7eb06
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
32 changes: 32 additions & 0 deletions scripts/test-conformance
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -e
cd $(dirname $0)/..

# sig-api-machinery e2e tests take about 20 minutes to complete.
# Only run conformance on sqlite, to reduce CI run time.
if [[ "$LABEL" != "sqlite" ]]; then
echo "Skipping conformance"
exit
fi

test-conformance() {
local count=$(inc-count conformance)
local testID=$(basename $TEST_DIR)
local name=$(echo "conformance-$count-$testID" | tee $TEST_DIR/conformance/$count/metadata/name)
local server_name=$(cat $TEST_DIR/servers/1/metadata/name)
local version=$(docker exec $server_name k3s --version | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
echo "Running conformance tests against $(grep server: $KUBECONFIG)"
stat $KUBECONFIG
docker container run \
--rm --name ${name} \
--entrypoint /usr/bin/sh \
-v "${TEST_DIR}/conformance/${count}/logs:/tmp/results" \
-v "${KUBECONFIG}:/root/.kube/config" \
-e "KUBECONFIG=/root/.kube/config" \
-e "E2E_FOCUS=sig-api-machinery" \
-e "E2E_SKIP=StorageVersionAPI|Slow|Flaky" \
registry.k8s.io/conformance:${version} \
-c 'stat $KUBECONFIG; find /root -ls; kubectl get node -o yaml'
}

test-conformance
9 changes: 6 additions & 3 deletions scripts/test-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ provision-server() {
-p $testPort:6443 \
-e K3S_DEBUG=true \
-e K3S_DATASTORE_ENDPOINT=$K3S_DATASTORE_ENDPOINT \
${K3S_IMAGE:-docker.io/rancher/k3s:v1.26.9-k3s1} server \
${K3S_IMAGE:-docker.io/rancher/k3s:v1.29.4-k3s1} server \
--kube-apiserver-arg=feature-gates=WatchList=true \
--disable=coredns,servicelb,traefik,local-storage,metrics-server \
--disable-agent --disable-scheduler --disable-cloud-controller --disable-kube-proxy --disable-network-policy
--disable-kube-proxy --disable-network-policy

local ip=$(docker container inspect --format '{{ .NetworkSettings.IPAddress }}' $name | tee $TEST_DIR/servers/$count/metadata/ip)
local port=$(docker container inspect --format '{{range $k, $v := .NetworkSettings.Ports}}{{printf "%s\n" $k}}{{end}}' $name | head -n 1 | cut -d/ -f1 | tee $TEST_DIR/servers/$count/metadata/port)
Expand Down Expand Up @@ -248,7 +249,9 @@ provision-kine() {
docker container run \
-d --name $name \
$KINE_ENV \
$KINE_IMAGE --endpoint $KINE_ENDPOINT
$KINE_IMAGE \
--watch-progress-notify-interval=5s \
--endpoint $KINE_ENDPOINT

local ip=$(docker container inspect --format '{{.NetworkSettings.IPAddress}}' $name | tee $TEST_DIR/kine/$count/metadata/ip)
local port=$(docker container inspect --format '{{range $k, $v := .NetworkSettings.Ports}}{{printf "%s\n" $k}}{{end}}' $name | head -n 1 | cut -d/ -f1 | tee $TEST_DIR/kine/$count/metadata/port)
Expand Down
1 change: 1 addition & 0 deletions scripts/test-runner
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ provision-database $DB_ARGS
start-test $@

./scripts/test-load
./scripts/test-conformance

0 comments on commit 7c7eb06

Please sign in to comment.