diff --git a/Makefile b/Makefile index ca72c5b4b..0d7dfa9ed 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ LDFLAGS += -X $(PROJECT_PKG)/internal/version.GitTreeState=${GIT_DIRTY} .PHONY: test test: tidy vendor check-encoding ## tidy and run tests - $(GO_EXE) test -race -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... ./... + $(GO_EXE) test -race -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=$($(GO_EXE) list ./... | grep -v internal/testutils | tr '\n' ',') ./... .PHONY: teste2e teste2e: ## run end to end tests diff --git a/cmd/oras/internal/display/status/progress/manager_test.go b/cmd/oras/internal/display/status/progress/manager_test.go index dc0b52890..01d2e4835 100644 --- a/cmd/oras/internal/display/status/progress/manager_test.go +++ b/cmd/oras/internal/display/status/progress/manager_test.go @@ -22,7 +22,7 @@ import ( "testing" "oras.land/oras/cmd/oras/internal/display/status/console" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) func Test_manager_render(t *testing.T) { diff --git a/cmd/oras/internal/display/status/progress/status_test.go b/cmd/oras/internal/display/status/progress/status_test.go index 9f8223f6e..8cb8ece6c 100644 --- a/cmd/oras/internal/display/status/progress/status_test.go +++ b/cmd/oras/internal/display/status/progress/status_test.go @@ -23,8 +23,8 @@ import ( ocispec "github.com/opencontainers/image-spec/specs-go/v1" "oras.land/oras/cmd/oras/internal/display/status/console" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" "oras.land/oras/cmd/oras/internal/display/status/progress/humanize" + "oras.land/oras/internal/testutils" ) func Test_status_String(t *testing.T) { diff --git a/cmd/oras/internal/display/status/track/target_test.go b/cmd/oras/internal/display/status/track/target_test.go index 3654ba482..7debc6a04 100644 --- a/cmd/oras/internal/display/status/track/target_test.go +++ b/cmd/oras/internal/display/status/track/target_test.go @@ -28,7 +28,7 @@ import ( "oras.land/oras-go/v2" "oras.land/oras-go/v2/content/memory" "oras.land/oras-go/v2/registry/remote" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) type testReferenceGraphTarget struct { diff --git a/cmd/oras/internal/display/status/tty_console_test.go b/cmd/oras/internal/display/status/tty_console_test.go index 49166b87a..3b7e853d4 100644 --- a/cmd/oras/internal/display/status/tty_console_test.go +++ b/cmd/oras/internal/display/status/tty_console_test.go @@ -21,8 +21,8 @@ import ( "context" "oras.land/oras-go/v2" "oras.land/oras-go/v2/content/memory" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" "oras.land/oras/cmd/oras/internal/display/status/track" + "oras.land/oras/internal/testutils" "testing" ) diff --git a/cmd/oras/internal/option/common_unix_test.go b/cmd/oras/internal/option/common_unix_test.go index 82d8f0ed4..7f5ae1679 100644 --- a/cmd/oras/internal/option/common_unix_test.go +++ b/cmd/oras/internal/option/common_unix_test.go @@ -20,7 +20,7 @@ package option import ( "testing" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) func TestCommon_parseTTY(t *testing.T) { diff --git a/cmd/oras/root/blob/fetch_test.go b/cmd/oras/root/blob/fetch_test.go index 3a9e11d1d..d51db2f03 100644 --- a/cmd/oras/root/blob/fetch_test.go +++ b/cmd/oras/root/blob/fetch_test.go @@ -25,7 +25,7 @@ import ( "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "oras.land/oras-go/v2/content/memory" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) func Test_fetchBlobOptions_doFetch(t *testing.T) { diff --git a/cmd/oras/root/blob/push_test.go b/cmd/oras/root/blob/push_test.go index 42edccdc5..154f3ae61 100644 --- a/cmd/oras/root/blob/push_test.go +++ b/cmd/oras/root/blob/push_test.go @@ -27,7 +27,7 @@ import ( "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "oras.land/oras-go/v2/content/memory" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) func Test_pushBlobOptions_doPush(t *testing.T) { diff --git a/cmd/oras/root/cp_test.go b/cmd/oras/root/cp_test.go index c347f05c9..c02ef5ea1 100644 --- a/cmd/oras/root/cp_test.go +++ b/cmd/oras/root/cp_test.go @@ -34,7 +34,7 @@ import ( ocispec "github.com/opencontainers/image-spec/specs-go/v1" "oras.land/oras-go/v2/content/memory" "oras.land/oras-go/v2/registry/remote" - "oras.land/oras/cmd/oras/internal/display/status/console/testutils" + "oras.land/oras/internal/testutils" ) var ( diff --git a/cmd/oras/internal/display/status/console/testutils/testutils.go b/internal/testutils/console.go similarity index 100% rename from cmd/oras/internal/display/status/console/testutils/testutils.go rename to internal/testutils/console.go