diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 191108de0e3..95acfe3cc6a 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -17,6 +17,14 @@ on: - master - release-** +# Only have one runner per PR, and per merged commit. +# +# - As a PR gets new commits, any old run jobs get cancelled (PR number) +# - As a commit gets merged, it doesn't cancel previous running PR's (github.sha) +concurrency: + group: ${{ github.event.pull_request.number || github.sha }}-ci-tests + cancel-in-progress: true + env: PYTHON_VERSION: "3.11" PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python @@ -86,6 +94,7 @@ jobs: pip install google pip install 'protobuf==4.24.4' + task --version task lint git add --all @@ -117,7 +126,7 @@ jobs: - name: Run Gateway Tests id: ci-tests run: | - task test:e2e args="-race -timeout=15m" + task test:e2e-combined args="-race -timeout=15m" task test:coverage # golangci-lint actions *require* issues-exit-code=0 to pass data along to sonarcloud @@ -144,7 +153,7 @@ jobs: -Dsonar.coverage.exclusions=**/*_test.go,**/mock/* -Dsonar.test.inclusions=**/*_test.go -Dsonar.tests=. - -Dsonar.go.coverage.reportPaths=coverage/*.cov + -Dsonar.go.coverage.reportPaths=coverage/gateway-all.cov -Dsonar.go.golangci-lint.reportPaths=golanglint.xml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.taskfiles/test.yml b/.taskfiles/test.yml index 64ca606cec2..a8e8468c9cd 100644 --- a/.taskfiles/test.yml +++ b/.taskfiles/test.yml @@ -44,7 +44,7 @@ tasks: package: sh: go mod edit -json | jq .Module.Path -r packages: - sh: go list ./... | tail -n +2 | sed -e 's|{{.package}}|.|g' + sh: go list ./... | sed -e 's|{{.package}}|.|g' cmds: - defer: { task: services:down } - rm -rf coverage && mkdir -p coverage diff --git a/docker/services/Taskfile.yml b/docker/services/Taskfile.yml index 7d9692bcfbb..b5a682e421d 100644 --- a/docker/services/Taskfile.yml +++ b/docker/services/Taskfile.yml @@ -5,7 +5,7 @@ tasks: up: desc: "Bring up services" cmds: - - docker compose up -d --remove-orphans + - docker compose up -d --remove-orphans --wait down: desc: "Tear down services" diff --git a/gateway/gateway_test.go b/gateway/gateway_test.go index 38a9ff6594c..2238f65e13c 100644 --- a/gateway/gateway_test.go +++ b/gateway/gateway_test.go @@ -41,7 +41,7 @@ func testKey(testName string, name string) string { func TestParambasedAuth(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.Auth.UseParam = true @@ -74,7 +74,7 @@ func TestParambasedAuth(t *testing.T) { func TestStripPathWithURLRewrite(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) t.Run("rewrite URL containing listen path", func(t *testing.T) { ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { @@ -104,7 +104,7 @@ func TestStripPathWithURLRewrite(t *testing.T) { func TestSkipTargetPassEscapingOff(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) t.Run("With escaping, default", func(t *testing.T) { globalConf := ts.Gw.GetConfig() @@ -212,7 +212,7 @@ func TestSkipTargetPassEscapingOffWithSkipURLCleaningTrue(t *testing.T) { c.HttpServerOptions.SkipURLCleaning = true } ts := StartTest(conf) - defer ts.Close() + t.Cleanup(ts.Close) ts.TestServerRouter.SkipClean(true) @@ -326,7 +326,7 @@ func TestQuota(t *testing.T) { test.Exclusive(t) // Uses quota, need to limit parallelism due to DeleteAllKeys. ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) var keyID string @@ -410,13 +410,15 @@ func TestQuota(t *testing.T) { func TestListener(t *testing.T) { ts := StartTest(nil) - defer ts.Close() - ts.Gw.ReloadTestCase.Enable() - defer ts.Gw.ReloadTestCase.Disable() - ts.Gw.ReloadTestCase.StartTicker() - defer ts.Gw.ReloadTestCase.StopTicker() + + t.Cleanup(func() { + ts.Gw.ReloadTestCase.StopTicker() + ts.Gw.ReloadTestCase.Disable() + ts.Close() + }) + tests := []test.TestCase{ // Cleanup before tests {Method: "DELETE", Path: "/tyk/apis/test", AdminAuth: true}, @@ -449,7 +451,7 @@ func TestListenerWithStrictRoutes(t *testing.T) { ts := StartTest(func(globalConf *config.Config) { globalConf.HttpServerOptions.EnableStrictRoutes = true }) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.ReloadTestCase.Enable() defer ts.Gw.ReloadTestCase.Disable() @@ -489,7 +491,7 @@ func TestControlListener(t *testing.T) { ts := StartTest(nil, TestConfig{ SeparateControlAPI: true, }) - defer ts.Close() + t.Cleanup(ts.Close) tests := []test.TestCase{ {Method: "GET", Path: "/", Code: 404}, @@ -526,7 +528,7 @@ func TestHttpPprof(t *testing.T) { ts := StartTest(conf, TestConfig{ SeparateControlAPI: true, }) - defer ts.Close() + t.Cleanup(ts.Close) _, _ = ts.Run(t, []test.TestCase{ {Path: "/debug/pprof/", Code: 404}, @@ -541,7 +543,7 @@ func TestHttpPprof(t *testing.T) { ts := StartTest(conf, TestConfig{ SeparateControlAPI: true, }) - defer ts.Close() + t.Cleanup(ts.Close) _, _ = ts.Run(t, []test.TestCase{ {Path: "/debug/pprof/", Code: 404}, @@ -553,7 +555,7 @@ func TestHttpPprof(t *testing.T) { func TestManagementNodeRedisEvents(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalConf := ts.Gw.GetConfig() globalConf.ManagementNode = false @@ -628,7 +630,7 @@ func TestManagementNodeRedisEvents(t *testing.T) { func TestListenPathTykPrefix(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.Proxy.ListenPath = "/tyk-foo/" @@ -659,7 +661,7 @@ func TestReloadGoroutineLeakWithTest(t *testing.T) { func TestReloadGoroutineLeakWithCircuitBreaker(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalConf := ts.Gw.GetConfig() globalConf.EnableJSVM = false @@ -721,7 +723,7 @@ func TestProxyProtocol(t *testing.T) { defer l.Close() go listenProxyProto(l) ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) rp, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatal(err) @@ -765,7 +767,7 @@ func TestProxyProtocol(t *testing.T) { func TestProxyUserAgent(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.Proxy.ListenPath = "/" @@ -785,7 +787,7 @@ func TestProxyUserAgent(t *testing.T) { func TestSkipUrlCleaning(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalConf := ts.Gw.GetConfig() globalConf.HttpServerOptions.OverrideDefaults = true @@ -809,7 +811,7 @@ func TestSkipUrlCleaning(t *testing.T) { func TestMultiTargetProxy(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.VersionData.NotVersioned = false @@ -839,7 +841,7 @@ func TestMultiTargetProxy(t *testing.T) { func TestCustomDomain(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) localClient := test.NewClientLocal() @@ -894,7 +896,7 @@ func TestGatewayHealthCheck(t *testing.T) { t.Run("control api port == listen port", func(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) t.Run("Without APIs", func(t *testing.T) { _, _ = ts.Run(t, []test.TestCase{ @@ -917,7 +919,7 @@ func TestGatewayHealthCheck(t *testing.T) { ts := StartTest(nil, TestConfig{ SeparateControlAPI: true, }) - defer ts.Close() + t.Cleanup(ts.Close) t.Run("Without APIs", func(t *testing.T) { _, _ = ts.Run(t, []test.TestCase{ @@ -940,10 +942,14 @@ func TestGatewayHealthCheck(t *testing.T) { } func TestCacheAllSafeRequests(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.CacheOptions = apidef.CacheOptions{ @@ -966,10 +972,15 @@ func TestCacheAllSafeRequests(t *testing.T) { } func TestCacheAllSafeRequestsWithCachedHeaders(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) + authorization := "authorization" tenant := "tenant-id" @@ -1007,10 +1018,14 @@ func TestCacheAllSafeRequestsWithCachedHeaders(t *testing.T) { } func TestCacheWithAdvanceUrlRewrite(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { version := spec.VersionData.Versions["v1"] @@ -1062,10 +1077,15 @@ func TestCacheWithAdvanceUrlRewrite(t *testing.T) { } func TestCachePostRequest(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) + tenant := "tenant-id" ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { @@ -1104,10 +1124,15 @@ func TestCachePostRequest(t *testing.T) { } func TestAdvanceCachePutRequest(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) + tenant := "tenant-id" ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { @@ -1192,10 +1217,14 @@ func TestAdvanceCachePutRequest(t *testing.T) { } func TestCacheAllSafeRequestsWithAdvancedCacheEndpoint(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.CacheOptions = apidef.CacheOptions{ @@ -1227,10 +1256,15 @@ func TestCacheAllSafeRequestsWithAdvancedCacheEndpoint(t *testing.T) { } func TestCacheEtag(t *testing.T) { + test.Exclusive(t) // Test is exclusive due to deleting all the cache from redis (interference). + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Etag", "12345") @@ -1260,8 +1294,7 @@ func TestCacheEtag(t *testing.T) { } func TestOldCachePlugin(t *testing.T) { - ts := StartTest(nil) - defer ts.Close() + test.Exclusive(t) // Test uses cache-* while other tests delete it. api := BuildAPI(func(spec *APISpec) { spec.Proxy.ListenPath = "/" @@ -1279,8 +1312,13 @@ func TestOldCachePlugin(t *testing.T) { check := func(t *testing.T) { t.Helper() + + ts := StartTest(nil) cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) ts.Gw.LoadAPI(api) _, _ = ts.Run(t, []test.TestCase{ @@ -1302,10 +1340,14 @@ func TestOldCachePlugin(t *testing.T) { } func TestAdvanceCacheTimeoutPerEndpoint(t *testing.T) { + test.Exclusive(t) // Need to limit parallelism due to DeleteScanMatch. + ts := StartTest(nil) - defer ts.Close() cache := storage.RedisCluster{KeyPrefix: "cache-", ConnectionHandler: ts.Gw.StorageConnectionHandler} - defer cache.DeleteScanMatch("*") + t.Cleanup(func() { + ts.Close() + cache.DeleteScanMatch("*") + }) extendedPaths := apidef.ExtendedPathsSet{ AdvanceCacheConfig: []apidef.CacheMeta{ @@ -1349,7 +1391,7 @@ func TestAdvanceCacheTimeoutPerEndpoint(t *testing.T) { func TestWebsocketsSeveralOpenClose(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalConf := ts.Gw.GetConfig() globalConf.HttpServerOptions.EnableWebSockets = true @@ -1446,7 +1488,7 @@ func TestWebsocketsSeveralOpenClose(t *testing.T) { func TestWebsocketsAndHTTPEndpointMatch(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalConf := ts.Gw.GetConfig() globalConf.HttpServerOptions.EnableWebSockets = true @@ -1579,7 +1621,7 @@ func createTestUptream(t *testing.T, allowedConns int, readsPerConn int) net.Lis func TestKeepAliveConns(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) t.Run("Should use same connection", func(t *testing.T) { // set keep alive option @@ -1658,7 +1700,7 @@ func TestKeepAliveConns(t *testing.T) { // API's global rate limit. func TestRateLimitForAPIAndRateLimitAndQuotaCheck(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) globalCfg := ts.Gw.GetConfig() globalCfg.EnableNonTransactionalRateLimiter = false @@ -1699,7 +1741,7 @@ func TestRateLimitForAPIAndRateLimitAndQuotaCheck(t *testing.T) { func TestTracing(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.prepareStorage() @@ -1756,7 +1798,7 @@ func TestBrokenClients(t *testing.T) { gwConf.ProxyDefaultTimeout = 1 } ts := StartTest(conf) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.UseKeylessAccess = true @@ -1802,7 +1844,7 @@ func TestCache_singleErrorResponse(t *testing.T) { })) ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) ts.Gw.BuildAndLoadAPI(func(spec *APISpec) { spec.UseKeylessAccess = true @@ -1835,7 +1877,7 @@ func TestCache_singleErrorResponse(t *testing.T) { func TestOverrideErrors(t *testing.T) { ts := StartTest(nil) - defer ts.Close() + t.Cleanup(ts.Close) defer defaultTykErrors() diff --git a/tests/regression/Taskfile.yml b/tests/regression/Taskfile.yml index 806c2fbb533..e70f85467a4 100644 --- a/tests/regression/Taskfile.yml +++ b/tests/regression/Taskfile.yml @@ -45,7 +45,7 @@ tasks: quiet: true vars: funcs: - sh: ./regression.test -test.list=Test | egrep -v 'Test_Issue[0-9]+' || true + sh: ./regression.test -test.list=Test | egrep -v '(Test_Issue[0-9]+|TestLoadAPISpec)' || true cmds: - cmd: '{{if ne .funcs ""}}echo -e "Naming violations:\n{{.funcs}}" && exit 1 {{end}}' diff --git a/tests/regression/issue_10104_test.go b/tests/regression/issue_10104_test.go index e3ee3b239be..5f2056b9502 100644 --- a/tests/regression/issue_10104_test.go +++ b/tests/regression/issue_10104_test.go @@ -13,7 +13,7 @@ func Test_Issue10104(t *testing.T) { t.Cleanup(ts.Close) // load api definition from file - ts.Gw.LoadAPI(loadAPISpec(t, "testdata/issue-10104-apidef.json")) + ts.Gw.LoadAPI(LoadAPISpec(t, "testdata/issue-10104-apidef.json")) // issue request against /test to trigger panic ts.Run(t, []test.TestCase{ diff --git a/tests/regression/issue_11806_test.go b/tests/regression/issue_11806_test.go index 589acee1e87..609415876a3 100644 --- a/tests/regression/issue_11806_test.go +++ b/tests/regression/issue_11806_test.go @@ -20,8 +20,8 @@ func Test_Issue11806_DomainRouting(t *testing.T) { conf.EnableCustomDomains = true } - noDomain := loadAPISpec(t, "testdata/issue-11806-api-no-domain.json") - withDomain := loadAPISpec(t, "testdata/issue-11806-api-with-domain.json") + noDomain := LoadAPISpec(t, "testdata/issue-11806-api-no-domain.json") + withDomain := LoadAPISpec(t, "testdata/issue-11806-api-with-domain.json") t.Run("Load listenPath without domain first", func(t *testing.T) { ts := gateway.StartTest(testConfig) diff --git a/tests/regression/issue_12865_test.go b/tests/regression/issue_12865_test.go index bb5ca5e5a6b..b373b6dc01f 100644 --- a/tests/regression/issue_12865_test.go +++ b/tests/regression/issue_12865_test.go @@ -17,10 +17,10 @@ func Test_Issue12865(t *testing.T) { c.HttpServerOptions.EnablePathPrefixMatching = false c.HttpServerOptions.EnablePathSuffixMatching = false }) - defer ts.Close() + t.Cleanup(ts.Close) // load api definition from file - api := loadAPISpec(t, "testdata/issue-12865.json") + api := LoadAPISpec(t, "testdata/issue-12865.json") ts.Gw.LoadAPI(api) @@ -56,10 +56,10 @@ func Test_Issue12865(t *testing.T) { c.HttpServerOptions.EnablePathPrefixMatching = true c.HttpServerOptions.EnablePathSuffixMatching = false }) - defer ts.Close() + t.Cleanup(ts.Close) // load api definition from file - api := loadAPISpec(t, "testdata/issue-12865.json") + api := LoadAPISpec(t, "testdata/issue-12865.json") ts.Gw.LoadAPI(api) @@ -95,10 +95,10 @@ func Test_Issue12865(t *testing.T) { c.HttpServerOptions.EnablePathPrefixMatching = true c.HttpServerOptions.EnablePathSuffixMatching = true }) - defer ts.Close() + t.Cleanup(ts.Close) // load api definition from file - api := loadAPISpec(t, "testdata/issue-12865.json") + api := LoadAPISpec(t, "testdata/issue-12865.json") ts.Gw.LoadAPI(api) @@ -134,10 +134,10 @@ func Test_Issue12865(t *testing.T) { c.HttpServerOptions.EnablePathPrefixMatching = false c.HttpServerOptions.EnablePathSuffixMatching = true }) - defer ts.Close() + t.Cleanup(ts.Close) // load api definition from file - api := loadAPISpec(t, "testdata/issue-12865.json") + api := LoadAPISpec(t, "testdata/issue-12865.json") ts.Gw.LoadAPI(api) diff --git a/tests/regression/regression_test.go b/tests/regression/regression_test.go index 653d0b78b23..9f0c632c9e2 100644 --- a/tests/regression/regression_test.go +++ b/tests/regression/regression_test.go @@ -1,11 +1,13 @@ package regression import ( + "bytes" "embed" "encoding/json" - "strings" + "os" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/TykTechnologies/tyk/apidef" @@ -17,27 +19,41 @@ var ( testdata embed.FS ) -func loadAPISpec(tb testing.TB, filename string) *gateway.APISpec { +func LoadAPISpec(tb testing.TB, filename string) *gateway.APISpec { tb.Helper() - data := loadFile(tb, filename) + data := LoadFile(tb, filename) apidef := &apidef.APIDefinition{} err := json.Unmarshal(data, apidef) require.NoError(tb, err, "Error decoding API Definition: %s", filename) - // auto replace from public to private endpoint, part of CI env - apidef.Proxy.ListenPath = strings.ReplaceAll(apidef.Proxy.ListenPath, "httpbin.org", "127.0.0.1:3123") - return &gateway.APISpec{ APIDefinition: apidef, } } -func loadFile(tb testing.TB, filename string) []byte { +func TestLoadAPISpec(t *testing.T) { + f := LoadAPISpec(t, "testdata/issue-10104-apidef.json") + + assert.Equal(t, f.APIDefinition.Proxy.TargetURL, "http://127.0.0.1:3123/") +} + +func LoadFile(tb testing.TB, filename string) []byte { tb.Helper() data, err := testdata.ReadFile(filename) + + httpbin := os.Getenv("HTTPBIN_IMAGE") + if httpbin == "" { + httpbin = "127.0.0.1:3123" + } + replacement := []byte("//" + httpbin) + + // auto replace from public to private endpoint, part of CI env + data = bytes.ReplaceAll(data, []byte("//httpbin.org"), replacement) + data = bytes.ReplaceAll(data, []byte("//google.com"), replacement) + require.NoError(tb, err, "Error reading file: %s", filename) return data diff --git a/tests/regression/testdata/issue-12865.json b/tests/regression/testdata/issue-12865.json index 123d0ebccdc..81fb2d829f2 100644 --- a/tests/regression/testdata/issue-12865.json +++ b/tests/regression/testdata/issue-12865.json @@ -292,7 +292,7 @@ "path": "/status", "method": "GET", "match_pattern": "/status/(.*)", - "rewrite_to": "http://google.com", + "rewrite_to": "http://httpbin.org", "triggers": [] } ],