Skip to content

Commit 43a72c7

Browse files
committed
update readme
1 parent 9e3d0b8 commit 43a72c7

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@ The steps are:
8888
4. Copy recursively the `deploy/kubernetes` folder to `deploy/kubernetes-dev` with `cp -rv deploy/kubernetes deploy/kubernetes-dev` and replace all occurences of `civo-csi:latest` in there with `YOUR_IMAGE_NAME:2h` (ENV variable interpolation won't work here), this folder is automatically in `.gitignore`
8989
5. In a test cluster (a Civo K3s 1 node cluster will work) you'll need to create a `Secret` within the `civo-system` called `api-access` containing the keys `api-key` set to your Civo API key, `api-url` pointing to either `https://api.civo.com` or a xip.io/ngrok pointing to your local development environment (depending on where your cluster is running) and `region` set to the region the current cluster is running in
9090
6. Deploy the Kubernetes resources required to the cluster with `kubectl apply -f deploy/kubernetes-dev`
91+
92+
93+
## e2e Testing
94+
95+
There are e2e tests included in this repo that will provision a cluster and run integrations against the cluster. These tests require a valid Civo API key to be present in the .env file (sample provided) in the root of the project dir. The tests can be found in the e2e directory and can be run with the following
96+
97+
```
98+
go test -v ./e2e/...
99+
```
100+
101+
To aid in development, the tests can be run with a `-retain` flag to persist the provisioned cluster between test runs:
102+
103+
```
104+
go test -v ./e2e/... -retain
105+
```

e2e/preexiting_volume_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package e2e
33
import (
44
"context"
55
"testing"
6-
"time"
76

87
. "github.com/onsi/gomega"
98
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -70,6 +69,7 @@ func Test_ExistingCivoVolume(t *testing.T) {
7069
err = e2eTest.tenantClient.Create(context.TODO(), pv)
7170
g.Expect(err).ShouldNot(HaveOccurred())
7271
defer func() {
72+
t.Log("Clean up PV")
7373
e2eTest.tenantClient.Get(context.TODO(), client.ObjectKeyFromObject(pv), pv)
7474
e2eTest.tenantClient.Delete(context.TODO(), pv)
7575
}()
@@ -93,6 +93,7 @@ func Test_ExistingCivoVolume(t *testing.T) {
9393
err = e2eTest.tenantClient.Create(context.TODO(), pvc)
9494
g.Expect(err).ShouldNot(HaveOccurred())
9595
defer func() {
96+
t.Log("Clean up PVC")
9697
e2eTest.tenantClient.Get(context.TODO(), client.ObjectKeyFromObject(pvc), pvc)
9798
e2eTest.tenantClient.Delete(context.TODO(), pvc)
9899
}()
@@ -112,6 +113,4 @@ func Test_ExistingCivoVolume(t *testing.T) {
112113
t.Log("Wait for deployment to become ready")
113114
g.Eventually(deployStateFunc(context.TODO(), e2eTest.tenantClient, g, deployment), "3m", "5s").Should(Equal("ready"))
114115

115-
time.Sleep(30 * time.Second)
116-
117116
}

0 commit comments

Comments
 (0)