Avoid importing "testing" in externally-facing code

The "testing" package adds some flags in its init function, so utilities
that import distribution code may print a page of extra testing flags in
their help output.

This commit solves the issue by moving an import of "testing" in the
registry/storage/cache package to a new
registry/storage/cache/cachecheck package, which is only imported by
tests.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann 2015-09-24 18:22:23 -07:00
parent 5a8fabfee3
commit b045aa2a3d
3 changed files with 10 additions and 9 deletions

View file

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/docker/distribution/registry/storage/cache"
"github.com/docker/distribution/registry/storage/cache/cachecheck"
"github.com/garyburd/redigo/redis"
)
@ -47,5 +47,5 @@ func TestRedisBlobDescriptorCacheProvider(t *testing.T) {
t.Fatalf("unexpected error flushing redis db: %v", err)
}
cache.CheckBlobDescriptorCache(t, NewRedisBlobDescriptorCacheProvider(pool))
cachecheck.CheckBlobDescriptorCache(t, NewRedisBlobDescriptorCacheProvider(pool))
}