From 38ee36eee464cc97b28aa2d7a9c1c9a689af4bb6 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Fri, 26 Aug 2016 16:10:11 -0700 Subject: [PATCH] Disable upload purging during test Signed-off-by: Derek McGowan (github: dmcgowan) --- registry/handlers/api_test.go | 15 +++++++++++++++ registry/handlers/app_test.go | 3 +++ registry/handlers/health_test.go | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/registry/handlers/api_test.go b/registry/handlers/api_test.go index 3bc18c76..1c609c64 100644 --- a/registry/handlers/api_test.go +++ b/registry/handlers/api_test.go @@ -220,6 +220,9 @@ func TestURLPrefix(t *testing.T) { config := configuration.Configuration{ Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, } config.HTTP.Prefix = "/test/" @@ -297,6 +300,9 @@ func TestRelativeURL(t *testing.T) { config := configuration.Configuration{ Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, } config.HTTP.Headers = headerConfig @@ -1886,6 +1892,9 @@ func newTestEnvMirror(t *testing.T, deleteEnabled bool) *testEnv { Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, "delete": configuration.Parameters{"enabled": deleteEnabled}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, Proxy: configuration.Proxy{ RemoteURL: "http://example.com", @@ -1901,6 +1910,9 @@ func newTestEnv(t *testing.T, deleteEnabled bool) *testEnv { Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, "delete": configuration.Parameters{"enabled": deleteEnabled}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, } @@ -2414,6 +2426,9 @@ func TestProxyManifestGetByTag(t *testing.T) { truthConfig := configuration.Configuration{ Storage: configuration.Storage{ "testdriver": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, } truthConfig.HTTP.Headers = headerConfig diff --git a/registry/handlers/app_test.go b/registry/handlers/app_test.go index 3a8e4e1e..1aac9b4c 100644 --- a/registry/handlers/app_test.go +++ b/registry/handlers/app_test.go @@ -143,6 +143,9 @@ func TestNewApp(t *testing.T) { config := configuration.Configuration{ Storage: configuration.Storage{ "testdriver": nil, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, Auth: configuration.Auth{ // For now, we simply test that new auth results in a viable diff --git a/registry/handlers/health_test.go b/registry/handlers/health_test.go index 5fe65ede..0f38bd1c 100644 --- a/registry/handlers/health_test.go +++ b/registry/handlers/health_test.go @@ -26,6 +26,9 @@ func TestFileHealthCheck(t *testing.T) { config := &configuration.Configuration{ Storage: configuration.Storage{ "inmemory": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, Health: configuration.Health{ FileCheckers: []configuration.FileChecker{ @@ -86,6 +89,9 @@ func TestTCPHealthCheck(t *testing.T) { config := &configuration.Configuration{ Storage: configuration.Storage{ "inmemory": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, Health: configuration.Health{ TCPCheckers: []configuration.TCPChecker{ @@ -145,6 +151,9 @@ func TestHTTPHealthCheck(t *testing.T) { config := &configuration.Configuration{ Storage: configuration.Storage{ "inmemory": configuration.Parameters{}, + "maintenance": configuration.Parameters{"uploadpurging": map[interface{}]interface{}{ + "enabled": false, + }}, }, Health: configuration.Health{ HTTPCheckers: []configuration.HTTPChecker{