From 8cb0e3398c35d147ac73f863fb2dbd96159999d6 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 5 Dec 2014 14:05:37 -0800 Subject: [PATCH] Disable s3, azure and ipc packages and testing The packages causing build errors are being disabled for now to let us split up the work in the different driver implementations without blocking integration into the main branch. The s3 and azure implementations need some effort to add Stat support. The ipc package needs that work plus some care around hanging send calls. --- storagedriver/azure/azure.go | 2 + storagedriver/azure/azure_test.go | 2 + storagedriver/factory/factory.go | 26 +++++++----- storagedriver/ipc/client.go | 2 + storagedriver/ipc/ipc.go | 2 + storagedriver/ipc/server.go | 2 + storagedriver/s3/s3.go | 2 + storagedriver/s3/s3_test.go | 2 + storagedriver/testsuites/testsuites.go | 56 ++++++++++++++------------ 9 files changed, 60 insertions(+), 36 deletions(-) diff --git a/storagedriver/azure/azure.go b/storagedriver/azure/azure.go index 489a63486..64402f3b1 100644 --- a/storagedriver/azure/azure.go +++ b/storagedriver/azure/azure.go @@ -1,3 +1,5 @@ +// +build ignore + // Package azure provides a storagedriver.StorageDriver implementation to // store blobs in Microsoft Azure Blob Storage Service. package azure diff --git a/storagedriver/azure/azure_test.go b/storagedriver/azure/azure_test.go index 888d1165e..1edcc1ea8 100644 --- a/storagedriver/azure/azure_test.go +++ b/storagedriver/azure/azure_test.go @@ -1,3 +1,5 @@ +// +build ignore + package azure import ( diff --git a/storagedriver/factory/factory.go b/storagedriver/factory/factory.go index 0b85f372e..0f8ca001c 100644 --- a/storagedriver/factory/factory.go +++ b/storagedriver/factory/factory.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/docker/docker-registry/storagedriver" - "github.com/docker/docker-registry/storagedriver/ipc" ) // driverFactories stores an internal mapping between storage driver names and their respective @@ -41,16 +40,23 @@ func Register(name string, factory StorageDriverFactory) { func Create(name string, parameters map[string]string) (storagedriver.StorageDriver, error) { driverFactory, ok := driverFactories[name] if !ok { + return nil, InvalidStorageDriverError{name} + + // NOTE(stevvooe): We are disabling storagedriver ipc for now, as the + // server and client need to be updated for the changed API calls and + // there were some problems libchan hanging. We'll phase this + // functionality back in over the next few weeks. + // No registered StorageDriverFactory found, try ipc - driverClient, err := ipc.NewDriverClient(name, parameters) - if err != nil { - return nil, InvalidStorageDriverError{name} - } - err = driverClient.Start() - if err != nil { - return nil, err - } - return driverClient, nil + // driverClient, err := ipc.NewDriverClient(name, parameters) + // if err != nil { + // return nil, InvalidStorageDriverError{name} + // } + // err = driverClient.Start() + // if err != nil { + // return nil, err + // } + // return driverClient, nil } return driverFactory.Create(parameters) } diff --git a/storagedriver/ipc/client.go b/storagedriver/ipc/client.go index 7e52a0841..2dc5c44e3 100644 --- a/storagedriver/ipc/client.go +++ b/storagedriver/ipc/client.go @@ -1,3 +1,5 @@ +// +build ignore + package ipc import ( diff --git a/storagedriver/ipc/ipc.go b/storagedriver/ipc/ipc.go index 82bdcbd73..45c546597 100644 --- a/storagedriver/ipc/ipc.go +++ b/storagedriver/ipc/ipc.go @@ -1,3 +1,5 @@ +// +build ignore + package ipc import ( diff --git a/storagedriver/ipc/server.go b/storagedriver/ipc/server.go index 1c0084f9b..fa0077a8c 100644 --- a/storagedriver/ipc/server.go +++ b/storagedriver/ipc/server.go @@ -1,3 +1,5 @@ +// +build ignore + package ipc import ( diff --git a/storagedriver/s3/s3.go b/storagedriver/s3/s3.go index 3d5cd511b..e26d3be2a 100644 --- a/storagedriver/s3/s3.go +++ b/storagedriver/s3/s3.go @@ -1,3 +1,5 @@ +// +build ignore + package s3 import ( diff --git a/storagedriver/s3/s3_test.go b/storagedriver/s3/s3_test.go index 6d7b3ff74..f7b4f80ec 100644 --- a/storagedriver/s3/s3_test.go +++ b/storagedriver/s3/s3_test.go @@ -1,3 +1,5 @@ +// +build ignore + package s3 import ( diff --git a/storagedriver/testsuites/testsuites.go b/storagedriver/testsuites/testsuites.go index 0967e2dbe..0e4f5be19 100644 --- a/storagedriver/testsuites/testsuites.go +++ b/storagedriver/testsuites/testsuites.go @@ -13,7 +13,6 @@ import ( "time" "github.com/docker/docker-registry/storagedriver" - "github.com/docker/docker-registry/storagedriver/ipc" "gopkg.in/check.v1" ) @@ -33,29 +32,34 @@ func RegisterInProcessSuite(driverConstructor DriverConstructor, skipCheck SkipC // RegisterIPCSuite registers a storage driver test suite which runs the named // driver as a child process with the given parameters. func RegisterIPCSuite(driverName string, ipcParams map[string]string, skipCheck SkipCheck) { - suite := &DriverSuite{ - Constructor: func() (storagedriver.StorageDriver, error) { - d, err := ipc.NewDriverClient(driverName, ipcParams) - if err != nil { - return nil, err - } - err = d.Start() - if err != nil { - return nil, err - } - return d, nil - }, - SkipCheck: skipCheck, - } - suite.Teardown = func() error { - if suite.StorageDriver == nil { - return nil - } + panic("ipc testing is disabled for now") - driverClient := suite.StorageDriver.(*ipc.StorageDriverClient) - return driverClient.Stop() - } - check.Suite(suite) + // NOTE(stevvooe): IPC testing is disabled for now. Uncomment the code + // block before and remove the panic when we phase it back in. + + // suite := &DriverSuite{ + // Constructor: func() (storagedriver.StorageDriver, error) { + // d, err := ipc.NewDriverClient(driverName, ipcParams) + // if err != nil { + // return nil, err + // } + // err = d.Start() + // if err != nil { + // return nil, err + // } + // return d, nil + // }, + // SkipCheck: skipCheck, + // } + // suite.Teardown = func() error { + // if suite.StorageDriver == nil { + // return nil + // } + + // driverClient := suite.StorageDriver.(*ipc.StorageDriverClient) + // return driverClient.Stop() + // } + // check.Suite(suite) } // SkipCheck is a function used to determine if a test suite should be skipped. @@ -520,9 +524,9 @@ func (suite *DriverSuite) TestStatCall(c *check.C) { // in to WriteStream concurrently without hanging. // TODO(bbland): fix this test... func (suite *DriverSuite) TestConcurrentFileStreams(c *check.C) { - if _, isIPC := suite.StorageDriver.(*ipc.StorageDriverClient); isIPC { - c.Skip("Need to fix out-of-process concurrency") - } + // if _, isIPC := suite.StorageDriver.(*ipc.StorageDriverClient); isIPC { + // c.Skip("Need to fix out-of-process concurrency") + // } var wg sync.WaitGroup