Skip to content

Commit 1e4864c

Browse files
committed
Adding Kubernetes integration test script
1 parent 55933e5 commit 1e4864c

File tree

9 files changed

+395
-3
lines changed

9 files changed

+395
-3
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Possible Kubernetes source location
2+
test/k8s-integration

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Compiled binaries and deployment files
22
bin/
3+
test/k8s-integration/src/
34

45
# Personal testing
56
/my_test/

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# GCE_PD_CSI_STAGING_IMAGE: Staging image repository
1717

1818
STAGINGIMAGE=${GCE_PD_CSI_STAGING_IMAGE}
19-
STAGINGVERSION=latest
19+
STAGINGVERSION=${GCE_PD_CSI_STAGING_VERSION}
2020

2121
PRODIMAGE=gcr.io/google-containers/volume-csi/gcp-compute-persistent-disk-csi-driver
2222
PRODVERSION=v0.1.0.alpha
@@ -25,11 +25,17 @@ all: gce-pd-driver
2525

2626
gce-pd-driver:
2727
mkdir -p bin
28+
ifndef GCE_PD_CSI_STAGING_VERSION
29+
$(error "Must set environment variable GCE_PD_CSI_STAGING_VERSION to staging version")
30+
endif
2831
go build -ldflags "-X main.vendorVersion=${STAGINGVERSION}" -o bin/gce-pd-csi-driver ./cmd/
2932

3033
build-container:
3134
ifndef GCE_PD_CSI_STAGING_IMAGE
3235
$(error "Must set environment variable GCE_PD_CSI_STAGING_IMAGE to staging image repository")
36+
endif
37+
ifndef GCE_PD_CSI_STAGING_VERSION
38+
$(error "Must set environment variable GCE_PD_CSI_STAGING_VERSION to staging version")
3339
endif
3440
docker build --build-arg TAG=$(STAGINGVERSION) -t $(STAGINGIMAGE):$(STAGINGVERSION) .
3541

@@ -44,3 +50,6 @@ prod-push-container: prod-build-container
4450

4551
test-sanity: gce-pd-driver
4652
go test -timeout 30s sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/test -run ^TestSanity$
53+
54+
test-k8s-integration:
55+
go build -o bin/k8s-integration-test ./test/k8s-integration

test/e2e/utils/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ func GCEClientAndDriverSetup(instance *remote.InstanceInfo) (*remote.TestContext
5656
Port: port,
5757
}
5858

59+
err := os.Setenv("GCE_PD_CSI_STAGING_VERSION", "latest")
60+
if err != nil {
61+
return nil, err
62+
}
63+
5964
return remote.SetupNewDriverAndClient(instance, config)
6065
}
6166

@@ -104,7 +109,7 @@ func SetupProwConfig() (project, serviceAccount string) {
104109
// Default Compute Engine service account
105110
// [PROJECT_NUMBER][email protected]
106111
serviceAccount = fmt.Sprintf("%[email protected]", resp.ProjectNumber)
107-
glog.V(4).Infof("Using project %v", project)
112+
glog.Infof("Using project %v and service account %v", project, serviceAccount)
108113
return project, serviceAccount
109114
}
110115

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
KUBE_GIT_COMMIT='somefakecommit'
2+
KUBE_GIT_TREE_STATE='dirty'
3+
KUBE_GIT_VERSION='v888.888.888-fake-testing-master.version'
4+
KUBE_GIT_MAJOR='888'
5+
KUBE_GIT_MINOR='888+'

0 commit comments

Comments
 (0)