From 0164c60174f995926db051b219730e6f023c0b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Wed, 10 Jul 2019 16:05:58 +0200 Subject: [PATCH 1/4] Replace the helloworld image by the pizzaplanetv1 image everywhere. --- test/conformance.go | 2 - .../conformance/api/v1beta1/migration_test.go | 4 +- test/e2e/destroypod_test.go | 6 +-- test/e2e/helloworld_test.go | 12 +++--- test/e2e/minscale_readiness_test.go | 2 +- test/e2e/pod_schedule_error_test.go | 2 +- test/e2e/scale.go | 4 +- test/e2e/service_to_service_test.go | 6 +-- test/e2e/subroutes_test.go | 2 +- test/performance/benchmarks_test.go | 2 +- test/performance/latency_test.go | 4 +- test/performance/scale_from_zero_test.go | 9 ++-- test/test_images/helloworld/README.md | 23 ----------- test/test_images/helloworld/helloworld.go | 38 ----------------- test/test_images/helloworld/helloworld.yaml | 41 ------------------- test/test_images/helloworld/service.yaml | 10 ----- 16 files changed, 26 insertions(+), 141 deletions(-) delete mode 100644 test/test_images/helloworld/README.md delete mode 100644 test/test_images/helloworld/helloworld.go delete mode 100644 test/test_images/helloworld/helloworld.yaml delete mode 100644 test/test_images/helloworld/service.yaml diff --git a/test/conformance.go b/test/conformance.go index 6ae8727814bd..d2f183f74aa7 100644 --- a/test/conformance.go +++ b/test/conformance.go @@ -31,7 +31,6 @@ const ( Autoscale = "autoscale" Failing = "failing" HelloVolume = "hellovolume" - HelloWorld = "helloworld" HTTPProxy = "httpproxy" InvalidHelloWorld = "invalidhelloworld" // Not a real image PizzaPlanet1 = "pizzaplanetv1" @@ -45,7 +44,6 @@ const ( // Constants for test image output. PizzaPlanetText1 = "What a spaceport!" PizzaPlanetText2 = "Re-energize yourself with a slice of pepperoni!" - HelloWorldText = "Hello World! How about some tasty noodles?" ConcurrentRequests = 50 // We expect to see 100% of requests succeed for traffic sent directly to revisions. diff --git a/test/conformance/api/v1beta1/migration_test.go b/test/conformance/api/v1beta1/migration_test.go index 441d3da6926f..e1ca30023e02 100644 --- a/test/conformance/api/v1beta1/migration_test.go +++ b/test/conformance/api/v1beta1/migration_test.go @@ -41,7 +41,7 @@ func TestV1beta1Translation(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) @@ -76,7 +76,7 @@ func TestV1beta1Rejection(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) diff --git a/test/e2e/destroypod_test.go b/test/e2e/destroypod_test.go index 025ebe6dcb59..24fd8d07fad3 100644 --- a/test/e2e/destroypod_test.go +++ b/test/e2e/destroypod_test.go @@ -54,7 +54,7 @@ func TestDestroyPodInflight(t *testing.T) { clients := Setup(t) t.Log("Creating a new Route and Configuration") - names, err := CreateRouteAndConfig(t, clients, "timeout", &v1a1test.Options{RevisionTimeoutSeconds: revisionTimeoutSeconds}) + names, err := CreateRouteAndConfig(t, clients, test.Timeout, &v1a1test.Options{RevisionTimeoutSeconds: revisionTimeoutSeconds}) if err != nil { t.Fatalf("Failed to create Route and Configuration: %v", err) } @@ -91,7 +91,7 @@ func TestDestroyPodInflight(t *testing.T) { "TimeoutAppServesText", test.ServingFlags.ResolvableDomain) if err != nil { - t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text \"%s\": %v", names.Route, domain, test.HelloWorldText, err) + t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text %q: %v", names.Route, domain, timeoutExpectedOutput, err) } client, err := pkgTest.NewSpoofingClient(clients.KubeClient, t.Logf, domain, test.ServingFlags.ResolvableDomain) @@ -153,7 +153,7 @@ func TestDestroyPodTimely(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } defer test.TearDown(clients, names) diff --git a/test/e2e/helloworld_test.go b/test/e2e/helloworld_test.go index 4366512f0dbf..7f7bd6222731 100644 --- a/test/e2e/helloworld_test.go +++ b/test/e2e/helloworld_test.go @@ -42,7 +42,7 @@ func TestHelloWorld(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) @@ -61,10 +61,10 @@ func TestHelloWorld(t *testing.T) { clients.KubeClient, t.Logf, domain, - v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))), + v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1))), "HelloWorldServesText", test.ServingFlags.ResolvableDomain); err != nil { - t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text \"%s\": %v", names.Route, domain, test.HelloWorldText, err) + t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text %q: %v", names.Route, domain, test.PizzaPlanetText1, err) } revision := resources.Revision @@ -93,7 +93,7 @@ func TestQueueSideCarResourceLimit(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) @@ -124,10 +124,10 @@ func TestQueueSideCarResourceLimit(t *testing.T) { clients.KubeClient, t.Logf, domain, - v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))), + v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1))), "HelloWorldServesText", test.ServingFlags.ResolvableDomain); err != nil { - t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text \"%s\": %v", names.Route, domain, test.HelloWorldText, err) + t.Fatalf("The endpoint for Route %s at domain %s didn't serve the expected text %q: %v", names.Route, domain, test.PizzaPlanetText1, err) } revision := resources.Revision diff --git a/test/e2e/minscale_readiness_test.go b/test/e2e/minscale_readiness_test.go index 6a56f30d9208..2e9961b90297 100644 --- a/test/e2e/minscale_readiness_test.go +++ b/test/e2e/minscale_readiness_test.go @@ -41,7 +41,7 @@ func TestMinScale(t *testing.T) { names := test.ResourceNames{ Config: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } if _, err := v1a1test.CreateConfiguration(t, clients, names, &v1a1test.Options{}, func(cfg *v1alpha1.Configuration) { diff --git a/test/e2e/pod_schedule_error_test.go b/test/e2e/pod_schedule_error_test.go index adcb39df708b..d48a56af6ce3 100644 --- a/test/e2e/pod_schedule_error_test.go +++ b/test/e2e/pod_schedule_error_test.go @@ -45,7 +45,7 @@ func TestPodScheduleError(t *testing.T) { ) names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } defer test.TearDown(clients, names) diff --git a/test/e2e/scale.go b/test/e2e/scale.go index 92bc1ebb64f7..b66d24166bc0 100644 --- a/test/e2e/scale.go +++ b/test/e2e/scale.go @@ -76,7 +76,7 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La wg.Go(func() error { names := test.ResourceNames{ Service: test.SubServiceNameForTest(t, fmt.Sprintf("%0[1]*[2]d", width, i)), - Image: "helloworld", + Image: test.PizzaPlanet1, } options := &v1a1test.Options{ @@ -144,7 +144,7 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La clients.KubeClient, t.Logf, domain, - v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))), + v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) if err != nil { diff --git a/test/e2e/service_to_service_test.go b/test/e2e/service_to_service_test.go index ccd8f03d22bc..60f51ac9359d 100644 --- a/test/e2e/service_to_service_test.go +++ b/test/e2e/service_to_service_test.go @@ -40,7 +40,7 @@ import ( const ( targetHostEnv = "TARGET_HOST" - helloworldResponse = "Hello World! How about some tasty noodles?" + helloworldResponse = "What a spaceport!" ) // testCases for table-driven testing. @@ -152,7 +152,7 @@ func TestServiceToServiceCall(t *testing.T) { t.Log("Creating a Service for the helloworld test app.") names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) @@ -203,7 +203,7 @@ func TestServiceToServiceCallFromZero(t *testing.T) { testNames := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } withInternalVisibility := WithServiceLabel( diff --git a/test/e2e/subroutes_test.go b/test/e2e/subroutes_test.go index d88ad72fc513..2e197997b23c 100644 --- a/test/e2e/subroutes_test.go +++ b/test/e2e/subroutes_test.go @@ -54,7 +54,7 @@ func TestSubrouteLocalSTS(t *testing.T) { // We can't use a longer more descript t.Log("Creating a Service for the helloworld test app.") names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: "helloworld", + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) diff --git a/test/performance/benchmarks_test.go b/test/performance/benchmarks_test.go index bb8a24f350c7..f3304492b6c0 100644 --- a/test/performance/benchmarks_test.go +++ b/test/performance/benchmarks_test.go @@ -36,7 +36,7 @@ import ( const ( reqTimeout = 30 * time.Second - app = "helloworld" + app = test.PizzaPlanet1 ) var loads = [...]int32{1, 100, 1000} diff --git a/test/performance/latency_test.go b/test/performance/latency_test.go index ca588a0315bd..0df24a4358bf 100644 --- a/test/performance/latency_test.go +++ b/test/performance/latency_test.go @@ -122,12 +122,12 @@ func timeToServe(t *testing.T, img, query string, reqTimeout time.Duration) { // Performs perf test on the hello world app func TestTimeToServeLatency(t *testing.T) { - timeToServe(t, "helloworld", "", hwReqtimeout) + timeToServe(t, test.PizzaPlanet1, "", hwReqtimeout) } // Performs perf testing on a long running app. // It uses the timeout app that sleeps for the specified amount of time. func TestTimeToServeLatencyLongRunning(t *testing.T) { q := fmt.Sprintf("timeout=%d", sleepTime/time.Millisecond) - timeToServe(t, "timeout", q, sleepReqTimeout) + timeToServe(t, test.Timeout, q, sleepReqTimeout) } diff --git a/test/performance/scale_from_zero_test.go b/test/performance/scale_from_zero_test.go index a8a52cee8697..664ddddc0df6 100644 --- a/test/performance/scale_from_zero_test.go +++ b/test/performance/scale_from_zero_test.go @@ -46,8 +46,7 @@ import ( const ( serviceName = "perftest-scalefromzero" - helloWorldExpectedOutput = "Hello World!" - helloWorldImage = "helloworld" + helloWorldExpectedOutput = "What a spaceport!" waitToServe = 10 * time.Minute ) @@ -75,11 +74,11 @@ func runScaleFromZero(idx int, t *testing.T, clients *test.Clients, ro *v1a1test clients.KubeClient, t.Logf, domain, - pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(helloWorldExpectedOutput)), + pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1)), "HelloWorldServesText", test.ServingFlags.ResolvableDomain, waitToServe) if err != nil { - m := fmt.Sprintf("%02d: the endpoint for Route %q at domain %q didn't serve the expected text %q: %v", idx, ro.Route.Name, domain, helloWorldExpectedOutput, err) + m := fmt.Sprintf("%02d: the endpoint for Route %q at domain %q didn't serve the expected text %q: %v", idx, ro.Route.Name, domain, test.PizzaPlanetText1, err) t.Log(m) return 0, errors.New(m) } @@ -100,7 +99,7 @@ func createServices(t *testing.T, pc *Client, count int) ([]*v1a1test.ResourceOb testNames[i] = &test.ResourceNames{ Service: test.AppendRandomString(fmt.Sprintf("%s-%02d", serviceName, i)), // The crd.go helpers will convert to the actual image path. - Image: helloWorldImage, + Image: test.PizzaPlanet1, } } diff --git a/test/test_images/helloworld/README.md b/test/test_images/helloworld/README.md deleted file mode 100644 index 785f32aa010e..000000000000 --- a/test/test_images/helloworld/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Helloworld test image - -This directory contains the test image used in the helloworld e2e test. - -The image contains a simple Go webserver, `helloworld.go`, that will, by -default, listen on port `8080` and expose a service at `/`. - -When called, the server emits a "hello world" message. - -## Trying out - -To run the image as a Service outisde of the test suite: - -`ko apply -f service.yaml` - -To run this image as just a Route and Configuration: - -`ko apply -f helloworld.yaml` - -## Building - -For details about building and adding new images, see the -[section about test images](/test/README.md#test-images). diff --git a/test/test_images/helloworld/helloworld.go b/test/test_images/helloworld/helloworld.go deleted file mode 100644 index cac24407ad51..000000000000 --- a/test/test_images/helloworld/helloworld.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "fmt" - "log" - "net/http" - - "github.com/knative/serving/test" -) - -func handler(w http.ResponseWriter, r *http.Request) { - log.Print("Hello world received a request.") - fmt.Fprintln(w, "Hello World! How about some tasty noodles?") -} - -func main() { - flag.Parse() - log.Print("Hello world app started.") - - test.ListenAndServeGracefully(":8080", handler) -} diff --git a/test/test_images/helloworld/helloworld.yaml b/test/test_images/helloworld/helloworld.yaml deleted file mode 100644 index 1053a2682301..000000000000 --- a/test/test_images/helloworld/helloworld.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: configuration-example - namespace: default -spec: - template: - spec: - containers: - - # This is the Go import path for the binary to containerize - # and substitute here. - image: github.com/knative/serving/test/test_images/helloworld - readinessProbe: - httpGet: - path: / - initialDelaySeconds: 3 - periodSeconds: 3 ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: route-example - namespace: default -spec: - traffic: - - configurationName: configuration-example - percent: 100 diff --git a/test/test_images/helloworld/service.yaml b/test/test_images/helloworld/service.yaml deleted file mode 100644 index ecab6d3b4e91..000000000000 --- a/test/test_images/helloworld/service.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: serving.knative.dev/v1alpha1 -kind: Service -metadata: - name: helloworld-test-image - namespace: default -spec: - template: - spec: - containers: - - image: github.com/knative/serving/test/test_images/helloworld From d299af6b006024736873bc9fe019cfe9b1c2930d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Wed, 10 Jul 2019 16:40:31 +0200 Subject: [PATCH 2/4] Fix all the places I forgot. --- test/conformance/api/v1alpha1/generatename_test.go | 8 ++++---- test/conformance/api/v1alpha1/service_test.go | 8 ++++---- test/conformance/api/v1beta1/generatename_test.go | 8 ++++---- test/conformance/api/v1beta1/service_test.go | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/conformance/api/v1alpha1/generatename_test.go b/test/conformance/api/v1alpha1/generatename_test.go index da357c6fe669..293a1a5a2c02 100644 --- a/test/conformance/api/v1alpha1/generatename_test.go +++ b/test/conformance/api/v1alpha1/generatename_test.go @@ -95,11 +95,11 @@ func canServeRequests(t *testing.T, clients *test.Clients, route *v1alpha1.Route clients.KubeClient, t.Logf, domain, - v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))), + v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanet1))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) if err != nil { - return fmt.Errorf("the endpoint for Route %s at domain %s didn't serve the expected text %q: %v", route.Name, domain, test.HelloWorldText, err) + return fmt.Errorf("the endpoint for Route %s at domain %s didn't serve the expected text %q: %v", route.Name, domain, test.PizzaPlanet1, err) } return nil @@ -114,7 +114,7 @@ func TestServiceGenerateName(t *testing.T) { generateName := generateNamePrefix(t) names := test.ResourceNames{ - Image: test.HelloWorld, + Image: test.PizzaPlanet1, } // Cleanup on test failure. @@ -151,7 +151,7 @@ func TestRouteAndConfigGenerateName(t *testing.T) { generateName := generateNamePrefix(t) names := test.ResourceNames{ - Image: test.HelloWorld, + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) diff --git a/test/conformance/api/v1alpha1/service_test.go b/test/conformance/api/v1alpha1/service_test.go index ad103d347442..1f9b7d9a8b2c 100644 --- a/test/conformance/api/v1alpha1/service_test.go +++ b/test/conformance/api/v1alpha1/service_test.go @@ -249,7 +249,7 @@ func TestReleaseService(t *testing.T) { // Create Initial Service clients := test.Setup(t) releaseImagePath2 := pkgTest.ImagePath(test.PizzaPlanet2) - releaseImagePath3 := pkgTest.ImagePath(test.HelloWorld) + releaseImagePath3 := pkgTest.ImagePath(test.PizzaPlanet1) names := test.ResourceNames{ Service: test.ObjectNameForTest(t), Image: test.PizzaPlanet1, @@ -261,7 +261,7 @@ func TestReleaseService(t *testing.T) { const ( expectedFirstRev = test.PizzaPlanetText1 expectedSecondRev = test.PizzaPlanetText2 - expectedThirdRev = test.HelloWorldText + expectedThirdRev = test.PizzaPlanetText1 ) // Setup initial Service @@ -587,8 +587,8 @@ func TestAnnotationPropagation(t *testing.T) { // Updating metadata does not trigger revision or generation // change, so let's generate a change that we can watch. t.Log("Updating the Service to use a different image.") - names.Image = test.HelloWorld - image3 := pkgTest.ImagePath(test.HelloWorld) + names.Image = test.PizzaPlanet1 + image3 := pkgTest.ImagePath(names.Image) if _, err := v1a1test.PatchServiceImage(t, clients, objects.Service, image3); err != nil { t.Fatalf("Patch update for Service %s with new image %s failed: %v", names.Service, image3, err) } diff --git a/test/conformance/api/v1beta1/generatename_test.go b/test/conformance/api/v1beta1/generatename_test.go index e7e5739db8ac..5bed4ad24e55 100644 --- a/test/conformance/api/v1beta1/generatename_test.go +++ b/test/conformance/api/v1beta1/generatename_test.go @@ -95,11 +95,11 @@ func canServeRequests(t *testing.T, clients *test.Clients, route *v1beta1.Route) clients.KubeClient, t.Logf, domain, - v1b1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText))), + v1b1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) if err != nil { - return fmt.Errorf("the endpoint for Route %s at domain %s didn't serve the expected text %q: %v", route.Name, domain, test.HelloWorldText, err) + return fmt.Errorf("the endpoint for Route %s at domain %s didn't serve the expected text %q: %v", route.Name, domain, test.PizzaPlanetText1, err) } return nil @@ -114,7 +114,7 @@ func TestServiceGenerateName(t *testing.T) { generateName := generateNamePrefix(t) names := test.ResourceNames{ - Image: test.HelloWorld, + Image: test.PizzaPlanet1, } // Cleanup on test failure. @@ -151,7 +151,7 @@ func TestRouteAndConfigGenerateName(t *testing.T) { generateName := generateNamePrefix(t) names := test.ResourceNames{ - Image: test.HelloWorld, + Image: test.PizzaPlanet1, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) diff --git a/test/conformance/api/v1beta1/service_test.go b/test/conformance/api/v1beta1/service_test.go index b20c5faf16b9..27518558b932 100644 --- a/test/conformance/api/v1beta1/service_test.go +++ b/test/conformance/api/v1beta1/service_test.go @@ -249,7 +249,7 @@ func TestServiceWithTrafficSplit(t *testing.T) { // Create Initial Service clients := test.Setup(t) releaseImagePath2 := pkgTest.ImagePath(test.PizzaPlanet2) - releaseImagePath3 := pkgTest.ImagePath(test.HelloWorld) + releaseImagePath3 := pkgTest.ImagePath(test.PizzaPlanet1) names := test.ResourceNames{ Service: test.ObjectNameForTest(t), Image: test.PizzaPlanet1, @@ -261,7 +261,7 @@ func TestServiceWithTrafficSplit(t *testing.T) { const ( expectedFirstRev = test.PizzaPlanetText1 expectedSecondRev = test.PizzaPlanetText2 - expectedThirdRev = test.HelloWorldText + expectedThirdRev = test.PizzaPlanetText1 ) // Setup initial Service @@ -553,7 +553,7 @@ func TestAnnotationPropagation(t *testing.T) { // Updating metadata does not trigger revision or generation // change, so let's generate a change that we can watch. t.Log("Updating the Service to use a different image.") - image3 := pkgTest.ImagePath(test.HelloWorld) + image3 := pkgTest.ImagePath(test.PizzaPlanet1) if _, err := v1b1test.PatchService(t, clients, objects.Service, rtesting.WithServiceImage(image3)); err != nil { t.Fatalf("Patch update for Service %s with new image %s failed: %v", names.Service, image3, err) } From dc3403525320c9cf327189594a934390ee6f2168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Wed, 10 Jul 2019 17:08:13 +0200 Subject: [PATCH 3/4] Fix misused constant. --- test/conformance/api/v1alpha1/generatename_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/conformance/api/v1alpha1/generatename_test.go b/test/conformance/api/v1alpha1/generatename_test.go index 293a1a5a2c02..4f2b985799d7 100644 --- a/test/conformance/api/v1alpha1/generatename_test.go +++ b/test/conformance/api/v1alpha1/generatename_test.go @@ -95,7 +95,7 @@ func canServeRequests(t *testing.T, clients *test.Clients, route *v1alpha1.Route clients.KubeClient, t.Logf, domain, - v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanet1))), + v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.PizzaPlanetText1))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) if err != nil { From c0a7572f1b6d5737245a8a7057a09364c649a87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Fri, 12 Jul 2019 11:07:33 +0200 Subject: [PATCH 4/4] Replace third version with single threaded image. --- test/conformance.go | 29 ++++++++++--------- test/conformance/api/v1alpha1/service_test.go | 4 +-- .../api/v1alpha1/single_threaded_test.go | 2 +- test/conformance/api/v1beta1/service_test.go | 4 +-- .../api/v1beta1/single_threaded_test.go | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/test/conformance.go b/test/conformance.go index d2f183f74aa7..4c2c2a9ad074 100644 --- a/test/conformance.go +++ b/test/conformance.go @@ -28,22 +28,23 @@ import ( // Constants for test images located in test/test_images. const ( // Test image names - Autoscale = "autoscale" - Failing = "failing" - HelloVolume = "hellovolume" - HTTPProxy = "httpproxy" - InvalidHelloWorld = "invalidhelloworld" // Not a real image - PizzaPlanet1 = "pizzaplanetv1" - PizzaPlanet2 = "pizzaplanetv2" - Protocols = "protocols" - Runtime = "runtime" - SingleThreadedImage = "singlethreaded" - Timeout = "timeout" - WorkingDir = "workingdir" + Autoscale = "autoscale" + Failing = "failing" + HelloVolume = "hellovolume" + HTTPProxy = "httpproxy" + InvalidHelloWorld = "invalidhelloworld" // Not a real image + PizzaPlanet1 = "pizzaplanetv1" + PizzaPlanet2 = "pizzaplanetv2" + Protocols = "protocols" + Runtime = "runtime" + SingleThreaded = "singlethreaded" + Timeout = "timeout" + WorkingDir = "workingdir" // Constants for test image output. - PizzaPlanetText1 = "What a spaceport!" - PizzaPlanetText2 = "Re-energize yourself with a slice of pepperoni!" + PizzaPlanetText1 = "What a spaceport!" + PizzaPlanetText2 = "Re-energize yourself with a slice of pepperoni!" + SingleThreadedText = "One at a time" ConcurrentRequests = 50 // We expect to see 100% of requests succeed for traffic sent directly to revisions. diff --git a/test/conformance/api/v1alpha1/service_test.go b/test/conformance/api/v1alpha1/service_test.go index 1f9b7d9a8b2c..5c42b73498bb 100644 --- a/test/conformance/api/v1alpha1/service_test.go +++ b/test/conformance/api/v1alpha1/service_test.go @@ -249,7 +249,7 @@ func TestReleaseService(t *testing.T) { // Create Initial Service clients := test.Setup(t) releaseImagePath2 := pkgTest.ImagePath(test.PizzaPlanet2) - releaseImagePath3 := pkgTest.ImagePath(test.PizzaPlanet1) + releaseImagePath3 := pkgTest.ImagePath(test.SingleThreaded) names := test.ResourceNames{ Service: test.ObjectNameForTest(t), Image: test.PizzaPlanet1, @@ -261,7 +261,7 @@ func TestReleaseService(t *testing.T) { const ( expectedFirstRev = test.PizzaPlanetText1 expectedSecondRev = test.PizzaPlanetText2 - expectedThirdRev = test.PizzaPlanetText1 + expectedThirdRev = test.SingleThreadedText ) // Setup initial Service diff --git a/test/conformance/api/v1alpha1/single_threaded_test.go b/test/conformance/api/v1alpha1/single_threaded_test.go index e6efefbc77ce..2db2a091b2f1 100644 --- a/test/conformance/api/v1alpha1/single_threaded_test.go +++ b/test/conformance/api/v1alpha1/single_threaded_test.go @@ -39,7 +39,7 @@ func TestSingleConcurrency(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: test.SingleThreadedImage, + Image: test.SingleThreaded, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) defer test.TearDown(clients, names) diff --git a/test/conformance/api/v1beta1/service_test.go b/test/conformance/api/v1beta1/service_test.go index 27518558b932..cf2715c0bb68 100644 --- a/test/conformance/api/v1beta1/service_test.go +++ b/test/conformance/api/v1beta1/service_test.go @@ -249,7 +249,7 @@ func TestServiceWithTrafficSplit(t *testing.T) { // Create Initial Service clients := test.Setup(t) releaseImagePath2 := pkgTest.ImagePath(test.PizzaPlanet2) - releaseImagePath3 := pkgTest.ImagePath(test.PizzaPlanet1) + releaseImagePath3 := pkgTest.ImagePath(test.SingleThreaded) names := test.ResourceNames{ Service: test.ObjectNameForTest(t), Image: test.PizzaPlanet1, @@ -261,7 +261,7 @@ func TestServiceWithTrafficSplit(t *testing.T) { const ( expectedFirstRev = test.PizzaPlanetText1 expectedSecondRev = test.PizzaPlanetText2 - expectedThirdRev = test.PizzaPlanetText1 + expectedThirdRev = test.SingleThreadedText ) // Setup initial Service diff --git a/test/conformance/api/v1beta1/single_threaded_test.go b/test/conformance/api/v1beta1/single_threaded_test.go index 05309d6ddfb3..b2bcd5809a4b 100644 --- a/test/conformance/api/v1beta1/single_threaded_test.go +++ b/test/conformance/api/v1beta1/single_threaded_test.go @@ -41,7 +41,7 @@ func TestSingleConcurrency(t *testing.T) { names := test.ResourceNames{ Service: test.ObjectNameForTest(t), - Image: test.SingleThreadedImage, + Image: test.SingleThreaded, } test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) defer test.TearDown(clients, names)