Skip to content

Commit 2b37d07

Browse files
committed
test: install metrics service in e2e test
fix test failure fix test failure
1 parent 1b81b38 commit 2b37d07

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,7 @@ build-push: blob-container
130130
clean:
131131
go clean -r -x
132132
-rm -rf _output
133+
134+
.PHONY: create-metrics-svc
135+
create-metrics-svc:
136+
kubectl create -f deploy/example/metrics/csi-blob-controller-svc.yaml

deploy/example/metrics/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ csi-blob-controller ClusterIP 10.0.156.8 20.39.0.113 29634/TCP 32m
1515
3. Run following command to get cloudprovider_azure metrics
1616
```console
1717
ip=`kubectl get svc csi-blob-controller -n kube-system | grep blob | awk '{print $4}'`
18-
curl http://$ip:29634/metrics | grep cloudprovider_azure
18+
curl http://$ip:29634/metrics | grep cloudprovider_azure | grep -e sum -e count
1919
```

test/e2e/suite_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,17 @@ var _ = ginkgo.BeforeSuite(func() {
8888
e2eBootstrap := testCmd{
8989
command: "make",
9090
args: []string{"e2e-bootstrap"},
91-
startLog: "Installing Azure Blob Storage CSI driver...",
91+
startLog: "Installing Azure Blob Storage CSI driver ...",
9292
endLog: "Azure Blob Storage CSI driver installed",
9393
}
94-
execTestCmd([]testCmd{e2eBootstrap})
9594

95+
createMetricsSVC := testCmd{
96+
command: "make",
97+
args: []string{"create-metrics-svc"},
98+
startLog: "create metrics service ...",
99+
endLog: "metrics service created",
100+
}
101+
execTestCmd([]testCmd{e2eBootstrap, createMetricsSVC})
96102
}
97103
nodeid := os.Getenv("nodeid")
98104
kubeconfig := os.Getenv(kubeconfigEnvVar)

test/utils/blob_log.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ LABEL='app=csi-blob-node'
4040
kubectl get pods -n${NS} -l${LABEL} \
4141
| awk 'NR>1 {print $1}' \
4242
| xargs -I {} kubectl logs {} --prefix -c${CONTAINER} -n${NS}
43+
44+
echo "print out cloudprovider_azure metrics ..."
45+
echo "======================================================================================"
46+
ip=`kubectl get svc csi-blob-controller -n kube-system | grep blob | awk '{print $4}'`
47+
curl http://$ip:29634/metrics

0 commit comments

Comments
 (0)