Skip to content

Commit bfb3f51

Browse files
srinivashegde86knative-prow-robot
authored andcommitted
Use knative/pkg/test components for common things (knative#1937)
* Use knative/pkg components * Update stringmatch method call as it has moved to common/v1alpha1 with istio * Run update-deps after merge * Fix nits * Update docker repo variable to point to correct e2e repo * Add a default serving namespace
1 parent 16d5cc1 commit bfb3f51

27 files changed

+408
-178
lines changed

Gopkg.lock

+36-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ required = [
3636

3737
[[constraint]]
3838
name = "github.com/knative/pkg"
39-
# HEAD as of 2018-08-23
40-
revision = "3ca427071dcd0b1155830a19bce769b4902fa645"
39+
# HEAD as of 2018-08-24
40+
revision = "6eff182b8784a136e0ce20e47c5efbfe40ae6059"
4141

4242
[[constraint]]
4343
name = "github.com/google/go-containerregistry"

test/adding_tests.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ By importing `github.com/knative/serving/test` you get access to a global variab
4242
`test.Flags` which holds the values of [the command line flags](/test/README.md#flags).
4343

4444
```go
45-
imagePath := strings.Join([]string{test.Flags.DockerRepo, image}, "/"))
45+
imagePath := strings.Join([]string{test.ServingFlags.DockerRepo, image}, "/"))
4646
```
4747

4848
_See [e2e_flags.go](./e2e_flags.go)._
@@ -162,13 +162,13 @@ ready to serve requests right away. To poll a deployed endpoint and wait for it
162162
in the state you want it to be in (or timeout) use `WaitForEndpointState`:
163163

164164
```go
165-
err = test.WaitForEndpointState(
166-
clients.KubeClient,
167-
logger,
168-
test.ServingFlags.ResolvableDomain,
169-
updatedRoute.Status.Domain,
170-
test.EventuallyMatchesBody(expectedText),
171-
"SomeDescription")
165+
err = pkgTest.WaitForEndpointState(
166+
clients.KubeClient,
167+
logger,
168+
updatedRoute.Status.Domain,
169+
pkgTest.EventuallyMatchesBody(expectedText),
170+
"SomeDescription",
171+
test.ServingFlags.ResolvableDomain)
172172
if err != nil {
173173
t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text \"%s\": %v", routeName, updatedRoute.Status.Domain, expectedText, err)
174174
}
@@ -185,7 +185,7 @@ service, you can directly use the `SpoofingClient` that `WaitForEndpointState` w
185185

186186
```go
187187
// Error handling elided for brevity, but you know better.
188-
client, err := spoof.New(clients.KubeClient.Kube, logger, route.Status.Domain, test.Flags.ResolvableDomain)
188+
client, err := pkgTest.NewSpoofingClient(clients.KubeClient.Kube, logger, route.Status.Domain, test.ServingFlags.ResolvableDomain)
189189
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s", route.Status.Domain), nil)
190190

191191
// Single request.

0 commit comments

Comments
 (0)