mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #341 from marquiz/devel/prow-e2e
scripts/test-infra: add script for end-to-end testing
This commit is contained in:
commit
27b5ef9680
3 changed files with 50 additions and 6 deletions
|
@ -18,12 +18,7 @@ script:
|
|||
set -e;
|
||||
echo "$IMAGE_REPO_PASSWORD" | docker login -u "$IMAGE_REPO_USER" --password-stdin quay.io;
|
||||
make push -e;
|
||||
curl -o $HOME/bin/aws-iam-authenticator --create-dirs https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator;
|
||||
chmod a+x $HOME/bin/aws-iam-authenticator;
|
||||
export PATH=$PATH:$HOME/bin;
|
||||
echo "$KUBECONFIG_AWS" > kubeconfig_aws;
|
||||
echo "$E2E_TEST_CONFIG_DATA" > e2e-test-config;
|
||||
make e2e-test -e KUBECONFIG=`pwd`/kubeconfig_aws E2E_TEST_CONFIG=`pwd`/e2e-test-config;
|
||||
scripts/test-infra/test-e2e.sh;
|
||||
fi
|
||||
|
||||
deploy:
|
||||
|
|
12
Makefile
12
Makefile
|
@ -87,3 +87,15 @@ e2e-test:
|
|||
|
||||
push:
|
||||
$(IMAGE_PUSH_CMD) $(IMAGE_TAG)
|
||||
|
||||
poll-image:
|
||||
set -e; \
|
||||
image=$(IMAGE_REPO):$(IMAGE_TAG_NAME); \
|
||||
base_url=`echo $(IMAGE_REPO) | sed -e s'!\([^/]*\)!\1/v2!'`; \
|
||||
errors=`curl -fsS -X GET https://$$base_url/manifests/$(IMAGE_TAG_NAME)|jq .errors`; \
|
||||
if [ "$$errors" = "null" ]; then \
|
||||
echo Image $$image found; \
|
||||
else \
|
||||
echo Image $$image not found; \
|
||||
exit 1; \
|
||||
fi;
|
||||
|
|
37
scripts/test-infra/test-e2e.sh
Executable file
37
scripts/test-infra/test-e2e.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# Install deps
|
||||
curl -o $HOME/bin/aws-iam-authenticator --create-dirs https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator
|
||||
chmod a+x $HOME/bin/aws-iam-authenticator
|
||||
export PATH=$PATH:$HOME/bin
|
||||
|
||||
|
||||
# Configure environment
|
||||
if [ -z "$IMAGE_TAG_NAME" ]; then
|
||||
export IMAGE_TAG_NAME="$_PULL_BASE_REF-g$COMMIT_SHA"
|
||||
fi
|
||||
export KUBECONFIG=`pwd`/kubeconfig
|
||||
export E2E_TEST_CONFIG=`pwd`/e2e-test-config
|
||||
|
||||
echo "$KUBECONFIG_DATA" > "$KUBECONFIG"
|
||||
echo "$E2E_TEST_CONFIG_DATA" > "$E2E_TEST_CONFIG"
|
||||
|
||||
|
||||
# Wait for the image to be built and published
|
||||
i=1
|
||||
while true; do
|
||||
if make poll-image -e; then
|
||||
break
|
||||
elif [ $i -ge 10 ]; then
|
||||
"ERROR: too many tries when polling for image"
|
||||
exit 1
|
||||
fi
|
||||
sleep 60
|
||||
|
||||
i=$(( $i + 1 ))
|
||||
done
|
||||
|
||||
|
||||
# Configure environment and run tests
|
||||
make e2e-test -e
|
||||
|
Loading…
Reference in a new issue