-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from phillc/master
Converge test suite to CCM
- Loading branch information
Showing
11 changed files
with
130 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export GO111MODULE=on | ||
IMG ?= linode/linode-blockstorage-csi-driver:latest | ||
|
||
imports: $(GOPATH)/bin/goimports | ||
goimports -w test | ||
|
||
.PHONY: test reuse-and-test clean | ||
|
||
reuse-and-test: SUITE_ARGS='--reuse' | ||
|
||
test reuse-and-test: $(GOPATH)/bin/ginkgo check-token | ||
go list -m; \ | ||
ginkgo -r --v --progress --trace --cover $(TEST_ARGS) -- --v=3 --image=${IMG} $(SUITE_ARGS); \ | ||
|
||
clean: check-token | ||
cd test; \ | ||
./scripts/delete_cluster.sh csi-linode-for-reuse; \ | ||
rm terraform.tfstate; \ | ||
rm -rf terraform.tfstate.d | ||
|
||
check-token: | ||
@if test "$(LINODE_API_TOKEN)" = "" ; then \ | ||
echo "LINODE_API_TOKEN must be set"; \ | ||
exit 1; \ | ||
fi | ||
|
||
install-terraform: | ||
sudo apt-get install wget unzip | ||
wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip | ||
unzip terraform_0.11.13_linux_amd64.zip | ||
sudo mv terraform /usr/local/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## How to run these End-to-end (e2e) tests | ||
|
||
Install the following packages (macOS examples) | ||
|
||
``` | ||
brew install terraform | ||
brew install kubectl | ||
brew install golang | ||
``` | ||
|
||
Add the following environment variables to your shell rc | ||
|
||
``` | ||
export LINODE_API_TOKEN=<your linode API token> | ||
export GOPATH=$HOME/go | ||
export PATH=$HOME/go/bin:$PATH | ||
export GO111MODULE=on | ||
``` | ||
|
||
If you need a Linode API token visit this page: | ||
https://cloud.linode.com/profile/tokens | ||
|
||
Then, `go get` this repo | ||
`go get github.com/linode/linode-blockstorage-csi-driver` | ||
|
||
That may fail, if it does, navigate to the directory that was created and run `go mod tidy`: | ||
|
||
``` | ||
cd ~/go/src/github.com/linode/linode-blockstorage-csi-driver | ||
go mod tidy | ||
``` | ||
|
||
Then, use the makefile in the directory above this directory to build the CSI (this is to download goimports) | ||
|
||
``` | ||
cd $GOPATH/src/github.com/linode/linode-blockstorage-csi-driver | ||
make build | ||
``` | ||
|
||
By default the tests use $HOME/.ssh/id\_rsa.pub as the public key used to provision the cluster, so it needs to be added to your agent. | ||
|
||
``` | ||
ssh-add $HOME/.ssh/id_rsa | ||
``` | ||
|
||
Come back here and run the tests | ||
|
||
``` | ||
cd e2e | ||
make test | ||
``` | ||
|
||
To save time on multiple runs by allowing the cluster to remain, use `make reuse-and-test` |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# dont commit temporary files written here by Terraform | ||
*.conf | ||
cluster.tf | ||
terraform* | ||
.terraform | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package test | ||
|
||
import ( | ||
"e2e_test/framework" | ||
"e2e_test/test/framework" | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters