Skip to content

Instantly share code, notes, and snippets.

@dlespiau
Last active June 12, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlespiau/5fe8b86e6c473eef2eaf5bff0830100a to your computer and use it in GitHub Desktop.
Save dlespiau/5fe8b86e6c473eef2eaf5bff0830100a to your computer and use it in GitHub Desktop.
Sampe kube-harness test
func TestConsistentAllRequestsAnswered(t *testing.T) {
t.Parallel()
test := kube.NewTest(t).Setup()
defer test.Close()
// Create a deploymenent from a manifest file and wait for all replicas to be ready.
service := test.CreateDeploymentFromFile(test.Namespace, "service-deploy.yaml")
test.WaitForDeploymentReady(service, 1*time.Minute)
// Query /info on each pod of the deployment and check the results
for _, pod := range test.ListPodsFromDeployment(service).Items {
stats := ServiceStats{}
test.PodProxyGetJSON(&pod, "", "/info", &stats)
// Check stats
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment