-
Notifications
You must be signed in to change notification settings - Fork 249
/
Copy pathtest-conformance
executable file
·34 lines (31 loc) · 1.38 KB
/
test-conformance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
cd $(dirname $0)/..
# sig-api-machinery e2e tests take about 20 minutes to complete.
# Only run conformance on sqlite and nats, to reduce CI run time.
if [[ "$LABEL" != "sqlite" ]]; then #--DISABLED UNTIL NATS PASSES TESTS--# && [[ "$LABEL" != "nats-embedded" ]]; 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)"
# We can't just mount $KUBECONFIG as a volume, because in CI this script is
# also running in a docker container, and the mount will not work.
docker container run \
--rm -d --name $name \
--entrypoint /usr/bin/sh \
-e "KUBECONFIG=/root/.kube/config" \
-e "E2E_FOCUS=sig-api-machinery" \
-e "E2E_SKIP=StorageVersionAPI|Slow|Flaky" \
-e "E2E_EXTRA_ARGS=--ginkgo.fail-fast" \
registry.k8s.io/conformance:$version \
-c 'mkdir -p /root/.kube; sleep 36000'
docker cp $KUBECONFIG $name:/root/.kube/config
docker exec $name /usr/local/bin/kubeconformance
}
test-conformance