Skip to content

Commit

Permalink
Update test HttpRequestBuilder DefaultHost from test.com to jsonplace…
Browse files Browse the repository at this point in the history
…holder.typicode.com/ (#10296)
  • Loading branch information
sheidkamp authored Nov 8, 2024
1 parent 1ebbfed commit 56f7e3d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
7 changes: 7 additions & 0 deletions changelog/v1.18.0-beta34/oss-test.com-flake-fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
changelog:
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/solo-projects/issues/5812
resolvesIssue: false
description: >-
Update the DefaultHost for the e2e testcontext to use `jsonplaceholder.typicode.com/` with the HttpRequestBuilder instead of
the inconsistent/not meant for testing `test.com`
8 changes: 4 additions & 4 deletions test/e2e/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ var _ = Describe("buffer", func() {
vsToTestUpstream := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithVirtualHostOptions(&gloov1.VirtualHostOptions{
BufferPerRoute: &buffer.BufferPerRoute{
Override: &buffer.BufferPerRoute_Buffer{
Expand Down Expand Up @@ -168,7 +168,7 @@ var _ = Describe("buffer", func() {
vsToTestUpstream := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithVirtualHostOptions(&gloov1.VirtualHostOptions{
BufferPerRoute: &buffer.BufferPerRoute{
Override: &buffer.BufferPerRoute_Buffer{
Expand Down Expand Up @@ -222,7 +222,7 @@ var _ = Describe("buffer", func() {
vsToTestUpstream := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithRoutePrefixMatcher("test", "/").
WithRouteActionToUpstream("test", testContext.TestUpstream().Upstream).
WithRouteOptions("test", &gloov1.RouteOptions{
Expand Down Expand Up @@ -271,7 +271,7 @@ var _ = Describe("buffer", func() {
vsToTestUpstream := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithRoutePrefixMatcher("test", "/").
WithRouteActionToUpstream("test", testContext.TestUpstream().Upstream).
WithRouteOptions("test", &gloov1.RouteOptions{
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/csrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var _ = Describe("CSRF", func() {
vs := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithRoutePrefixMatcher("test", "/").
WithRouteActionToUpstream("test", testContext.TestUpstream().Upstream).
WithRouteOptions("test", &gloov1.RouteOptions{
Expand Down Expand Up @@ -173,7 +173,7 @@ var _ = Describe("CSRF", func() {
vs := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithVirtualHostOptions(&gloov1.VirtualHostOptions{
Csrf: getCsrfPolicyWithFilterEnabled(allowedOrigin),
}).
Expand Down Expand Up @@ -202,7 +202,7 @@ var _ = Describe("CSRF", func() {
vs := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithRoutePrefixMatcher("test", "/").
WithRouteActionToMultiDestination("test", &gloov1.MultiDestination{
Destinations: []*gloov1.WeightedDestination{{
Expand Down Expand Up @@ -245,7 +245,7 @@ var _ = Describe("CSRF", func() {
vs := helpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithVirtualHostOptions(&gloov1.VirtualHostOptions{
Csrf: getCsrfPolicyWithFilterEnabled(allowedOrigin),
}).
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
// To make our tests more explicit we define VirtualServices with an explicit set
// of domains (which match the `Host` header of a request), and DefaultHost
// is the domain we use by default
DefaultHost = "test.com"
DefaultHost = "jsonplaceholder.typicode.com"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"time"

"github.com/solo-io/gloo/test/e2e"
"github.com/solo-io/gloo/test/services/envoy"

"github.com/solo-io/gloo/test/testutils"
Expand Down Expand Up @@ -129,7 +130,7 @@ var _ = Describe("Tracing config loading", Serial, func() {
vsToTestUpstream := gloohelpers.NewVirtualServiceBuilder().
WithName("vs-test").
WithNamespace(writeNamespace).
WithDomain("test.com").
WithDomain(e2e.DefaultHost).
WithRoutePrefixMatcher("test", "/").
WithRouteActionToUpstream("test", testUpstream.Upstream).
Build()
Expand Down Expand Up @@ -197,7 +198,7 @@ var _ = Describe("Tracing config loading", Serial, func() {
v1helpers.CurlRequest{
RootCA: nil,
Port: envoyInstance.HttpPort,
Host: "test.com", // to match the vs-test
Host: e2e.DefaultHost, // to match the vs-test
Path: "/",
Body: []byte("solo.io test"),
},
Expand Down

0 comments on commit 56f7e3d

Please sign in to comment.