Last active
June 12, 2018 09:26
-
-
Save dlespiau/5fe8b86e6c473eef2eaf5bff0830100a to your computer and use it in GitHub Desktop.
Sampe kube-harness test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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