Skip to content

Commit

Permalink
ops#15: Added some timings for Linux Kubernetes Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Samuel committed Mar 1, 2018
1 parent 320eda4 commit c55f883
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ linux_kubernetes:
- ubuntu
- fast
script:
- pwd
- ./test.sh -run TestKubernetes

linux_deletion_simple:
Expand Down
2 changes: 1 addition & 1 deletion tests/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion tests/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -1620,6 +1624,7 @@ spec:
matchLabels:
apples: tree
`)
citools.LogTiming("FlexVolume: PV Claim")

citools.KubectlApply(t, node1.Container, `
apiVersion: extensions/v1beta1
Expand All @@ -1645,6 +1650,7 @@ spec:
name: apple-storage
`)

citools.LogTiming("FlexVolume: apple Deployment")
citools.KubectlApply(t, node1.Container, `
apiVersion: v1
kind: Service
Expand All @@ -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 {
Expand All @@ -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) {
Expand All @@ -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:
Expand All @@ -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 "+
Expand Down Expand Up @@ -1746,6 +1759,7 @@ spec:
name: grape-storage
`)

citools.LogTiming("DynamicProvisioning: grape Deployment")
citools.KubectlApply(t, node1.Container, `
apiVersion: v1
kind: Service
Expand All @@ -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 {
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/vendor/github.com/dotmesh-io/citools/testtools.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c55f883

Please sign in to comment.