Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions test/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@ import (
// Constants for test images located in test/test_images.
const (
// Test image names
Autoscale = "autoscale"
Failing = "failing"
HelloVolume = "hellovolume"
HelloWorld = "helloworld"
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!"
HelloWorldText = "Hello World! How about some tasty noodles?"
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.
Expand Down
8 changes: 4 additions & 4 deletions test/conformance/api/v1alpha1/generatename_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.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.PizzaPlanet1, err)
}

return nil
Expand All @@ -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.
Expand Down Expand Up @@ -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) })
Expand Down
8 changes: 4 additions & 4 deletions test/conformance/api/v1alpha1/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.SingleThreaded)
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: test.PizzaPlanet1,
Expand All @@ -261,7 +261,7 @@ func TestReleaseService(t *testing.T) {
const (
expectedFirstRev = test.PizzaPlanetText1
expectedSecondRev = test.PizzaPlanetText2
expectedThirdRev = test.HelloWorldText
Comment thread
markusthoemmes marked this conversation as resolved.
expectedThirdRev = test.SingleThreadedText
)

// Setup initial Service
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/api/v1alpha1/single_threaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions test/conformance/api/v1beta1/generatename_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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) })
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/api/v1beta1/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
Expand Down Expand Up @@ -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) })
Expand Down
6 changes: 3 additions & 3 deletions test/conformance/api/v1beta1/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.SingleThreaded)
names := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: test.PizzaPlanet1,
Expand All @@ -261,7 +261,7 @@ func TestServiceWithTrafficSplit(t *testing.T) {
const (
expectedFirstRev = test.PizzaPlanetText1
expectedSecondRev = test.PizzaPlanetText2
expectedThirdRev = test.HelloWorldText
expectedThirdRev = test.SingleThreadedText
)

// Setup initial Service
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/api/v1beta1/single_threaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/destroypod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/helloworld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
Expand All @@ -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
Expand Down Expand Up @@ -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) })
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/minscale_readiness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pod_schedule_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/service_to_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) })
Expand Down Expand Up @@ -203,7 +203,7 @@ func TestServiceToServiceCallFromZero(t *testing.T) {

testNames := test.ResourceNames{
Service: test.ObjectNameForTest(t),
Image: "helloworld",
Image: test.PizzaPlanet1,
}

withInternalVisibility := WithServiceLabel(
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/subroutes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
Expand Down
2 changes: 1 addition & 1 deletion test/performance/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

const (
reqTimeout = 30 * time.Second
app = "helloworld"
app = test.PizzaPlanet1
)

var loads = [...]int32{1, 100, 1000}
Expand Down
4 changes: 2 additions & 2 deletions test/performance/latency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
9 changes: 4 additions & 5 deletions test/performance/scale_from_zero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ import (

const (
serviceName = "perftest-scalefromzero"
helloWorldExpectedOutput = "Hello World!"
helloWorldImage = "helloworld"
helloWorldExpectedOutput = "What a spaceport!"
waitToServe = 10 * time.Minute
)

Expand Down Expand Up @@ -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)
}
Expand All @@ -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,
}
}

Expand Down
Loading