From c55f883e580628cc5da24dcaa836a6fe5b363a1c Mon Sep 17 00:00:00 2001 From: Priya Samuel Date: Thu, 1 Mar 2018 17:20:00 +0000 Subject: [PATCH] ops#15: Added some timings for Linux Kubernetes Tests --- .gitlab-ci.yml | 1 + tests/Gopkg.lock | 2 +- tests/acceptance_test.go | 19 ++++++++++++++++++- .../dotmesh-io/citools/testtools.go | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04fd7098b..911514890 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,6 +198,7 @@ linux_kubernetes: - ubuntu - fast script: + - pwd - ./test.sh -run TestKubernetes linux_deletion_simple: diff --git a/tests/Gopkg.lock b/tests/Gopkg.lock index 7591ca65b..1df9dcaf9 100644 --- a/tests/Gopkg.lock +++ b/tests/Gopkg.lock @@ -5,7 +5,7 @@ branch = "master" name = "github.com/dotmesh-io/citools" packages = ["."] - revision = "cfa9e3a2c3832024103ad7908ca07c02c8a1c67a" + revision = "c9f8210ce2f9f3bdc3b6652e6f0ffc73e5a5240b" [[projects]] name = "github.com/gorilla/rpc" diff --git a/tests/acceptance_test.go b/tests/acceptance_test.go index e91364469..9c689eaf0 100644 --- a/tests/acceptance_test.go +++ b/tests/acceptance_test.go @@ -1570,6 +1570,7 @@ func TestKubernetes(t *testing.T) { } node1 := f[0].GetNode(0) + citools.LogTiming("setup") t.Run("FlexVolume", func(t *testing.T) { // dm list should succeed in connecting to the dotmesh cluster @@ -1581,6 +1582,7 @@ func TestKubernetes(t *testing.T) { "busybox sh -c \"echo 'apples' > /foo/on-the-tree\"", ) + citools.LogTiming("FlexVolume: init") // create a PV referencing the data citools.KubectlApply(t, node1.Container, ` kind: PersistentVolume @@ -1601,6 +1603,8 @@ spec: namespace: admin name: apples `) + + citools.LogTiming("FlexVolume: create PV") // run a pod with a PVC which lists the data (web server) // check that the output of querying the pod is that we can see // that the apples are on the tree @@ -1620,6 +1624,7 @@ spec: matchLabels: apples: tree `) + citools.LogTiming("FlexVolume: PV Claim") citools.KubectlApply(t, node1.Container, ` apiVersion: extensions/v1beta1 @@ -1645,6 +1650,7 @@ spec: name: apple-storage `) + citools.LogTiming("FlexVolume: apple Deployment") citools.KubectlApply(t, node1.Container, ` apiVersion: v1 kind: Service @@ -1659,6 +1665,8 @@ spec: nodePort: 30003 `) + citools.LogTiming("FlexVolume: apple Service") + err = citools.TryUntilSucceeds(func() error { resp, err := http.Get(fmt.Sprintf("http://%s:30003/on-the-tree", node1.IP)) if err != nil { @@ -1677,6 +1685,8 @@ spec: if err != nil { t.Error(err) } + + citools.LogTiming("FlexVolume: Apples on the Tree") }) t.Run("DynamicProvisioning", func(t *testing.T) { @@ -1703,6 +1713,7 @@ spec: storage: 1Gi `) + citools.LogTiming("DynamicProvisioning: PV Claim") err = citools.TryUntilSucceeds(func() error { result := citools.OutputFromRunOnNode(t, node1.Container, "kubectl get pv") // We really want a line like: @@ -1716,6 +1727,8 @@ spec: t.Error(err) } + citools.LogTiming("DynamicProvisioning: finding grapes PV") + // Now let's see if a container can see it, and put content there that a k8s container can pick up citools.RunOnNode(t, node1.Container, "docker run --rm -i -v k8s/dynamic-grapes.static-html:/foo --volume-driver dm "+ @@ -1746,6 +1759,7 @@ spec: name: grape-storage `) + citools.LogTiming("DynamicProvisioning: grape Deployment") citools.KubectlApply(t, node1.Container, ` apiVersion: v1 kind: Service @@ -1760,6 +1774,7 @@ spec: nodePort: 30050 `) + citools.LogTiming("DynamicProvisioning: grape Service") err = citools.TryUntilSucceeds(func() error { resp, err := http.Get(fmt.Sprintf("http://%s:30050/on-the-vine", node1.IP)) if err != nil { @@ -1778,8 +1793,10 @@ spec: if err != nil { t.Error(err) } - }) + citools.LogTiming("DynamicProvisioning: Grapes on the vine") + }) + citools.DumpTiming() } func TestStress(t *testing.T) { diff --git a/tests/vendor/github.com/dotmesh-io/citools/testtools.go b/tests/vendor/github.com/dotmesh-io/citools/testtools.go index 25b2c86fa..d608e5be6 100644 --- a/tests/vendor/github.com/dotmesh-io/citools/testtools.go +++ b/tests/vendor/github.com/dotmesh-io/citools/testtools.go @@ -43,7 +43,7 @@ func LogTiming(tag string) { lastTiming = now } -func dumpTiming() { +func DumpTiming() { fmt.Printf("=== TIMING ===\n") for tag, timing := range timings { fmt.Printf("%s => %.2f\n", tag, timing)