From 6ca7b9e9fa5d60cf5174d0e6d260711a6e10fae7 Mon Sep 17 00:00:00 2001 From: Fernando Mayo Fernandez Date: Sun, 15 Dec 2019 13:51:25 +0100 Subject: [PATCH] Fix TestRegistryAsCacheMutationAPIs Use a synthetic upstream registry when creating the testing mirror configuration to avoid the test fail when trying to reach http://example.com Signed-off-by: Fernando Mayo Fernandez --- registry/handlers/api_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registry/handlers/api_test.go b/registry/handlers/api_test.go index e5f9be62..e0a9e746 100644 --- a/registry/handlers/api_test.go +++ b/registry/handlers/api_test.go @@ -2012,6 +2012,7 @@ type testEnv struct { } func newTestEnvMirror(t *testing.T, deleteEnabled bool) *testEnv { + upstreamEnv := newTestEnv(t, deleteEnabled) config := configuration.Configuration{ Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, @@ -2021,7 +2022,7 @@ func newTestEnvMirror(t *testing.T, deleteEnabled bool) *testEnv { }}, }, Proxy: configuration.Proxy{ - RemoteURL: "http://example.com", + RemoteURL: upstreamEnv.server.URL, }, } config.Compatibility.Schema1.Enabled = true