Skip to content

Commit

Permalink
Merge pull request #162 from kschumy/test-integration-with-prow
Browse files Browse the repository at this point in the history
Test integration with prow
  • Loading branch information
k8s-ci-robot authored Dec 28, 2018
2 parents 0f66ac5 + 4a6844e commit 4f5f8e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,24 @@ GIT_COMMIT?=$(shell git rev-parse HEAD)
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS?="-X ${PKG}/pkg/driver.driverVersion=${VERSION} -X ${PKG}/pkg/driver.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/driver.buildDate=${BUILD_DATE}"

AWS_K8S_TESTER_VERSION?=0.1.9
# Hard-coded version is needed in case GitHub API rate limit is exceeded.
# TODO: When aws-k8s-tester becomes a full release (https://developer.github.com/v3/repos/releases/#get-the-latest-release), use:
# $(shell curl -s --request GET --url https://api.github.com/repos/aws/aws-k8s-tester/releases/latest | jq -r '.tag_name? // "<current version number>"')
AWS_K8S_TESTER_VERSION?=$(shell curl -s --request GET --url https://api.github.com/repos/aws/aws-k8s-tester/tags | jq -r '.[0]?.name // "0.1.9"')
AWS_K8S_TESTER_OS_ARCH?=$(shell go env GOOS)-amd64
AWS_K8S_TESTER_DOWNLOAD_URL?=https://github.com/aws/aws-k8s-tester/releases/download/${AWS_K8S_TESTER_VERSION}/aws-k8s-tester-${AWS_K8S_TESTER_VERSION}-${AWS_K8S_TESTER_OS_ARCH}
AWS_K8S_TESTER_PATH?=/tmp/aws-k8s-tester

VPC_ID_FLAG=
ifdef AWS_K8S_TESTER_VPC_ID
VPC_ID_FLAG=--vpc-id=${AWS_K8S_TESTER_VPC_ID}
endif

CSI_FLAG=--csi=master
ifdef PULL_NUMBER
CSI_FLAG=--csi=${PULL_NUMBER}
endif

.PHONY: aws-ebs-csi-driver
aws-ebs-csi-driver:
mkdir -p bin
Expand All @@ -41,7 +54,7 @@ test-sanity:
test-integration:
curl -L ${AWS_K8S_TESTER_DOWNLOAD_URL} -o ${AWS_K8S_TESTER_PATH}
chmod +x ${AWS_K8S_TESTER_PATH}
aws-k8s-tester csi test integration --terminate-on-exit=true --csi=master --timeout=20m
${AWS_K8S_TESTER_PATH} csi test integration --terminate-on-exit=true --timeout=20m ${CSI_FLAG} ${VPC_ID_FLAG}

.PHONY: test-e2e
test-e2e:
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Must satisfy also the requirements for `aws-ebs-csi-driver`
make test-integration
```

#### Overriding Defaults
- The master branch of `aws-ebs-csi-driver` is used by default. To run using a pull request for `aws-ebs-csi-driver`, set `PULL_NUMBER` as an environment variable with a value equal to the pull request number.

- When the tests are run, a new VPC is created by default. To run using an existing VPC, set `AWS_K8S_TESTER_VPC_ID` as an environment variable with a value equal to an existing VPC ID.

### Additional Information

- GitHub [repo](https://github.com/aws/aws-k8s-tester) for `aws-k8s-tester`, which includes information about releases and running locally
Expand Down

0 comments on commit 4f5f8e4

Please sign in to comment.