From cd8d2c0e043f69c3444a31186fac26438d67fe13 Mon Sep 17 00:00:00 2001 From: tochemey Date: Wed, 7 Feb 2024 23:58:39 +0000 Subject: [PATCH] refactor: fix broken mocks package --- .codecov.yml | 1 + Earthfile | 2 +- actors/actor_system_test.go | 3 ++- cluster/discovery_test.go | 3 ++- cluster/hasher_test.go | 3 ++- cluster/node_test.go | 3 ++- cluster/option_test.go | 3 ++- {test/mocks => mocks}/cluster/interface.go | 0 {test/mocks => mocks}/cluster/option.go | 0 {test/mocks => mocks}/cluster/option_func.go | 0 {test/mocks => mocks}/discovery/nats/option.go | 0 {test/mocks => mocks}/discovery/nats/option_func.go | 0 {test/mocks => mocks}/discovery/provider.go | 0 {test/mocks => mocks}/hash/hasher.go | 0 .../internal/v1/internalpbconnect/remoting_service_client.go | 0 .../internal/v1/internalpbconnect/remoting_service_handler.go | 0 16 files changed, 12 insertions(+), 6 deletions(-) rename {test/mocks => mocks}/cluster/interface.go (100%) rename {test/mocks => mocks}/cluster/option.go (100%) rename {test/mocks => mocks}/cluster/option_func.go (100%) rename {test/mocks => mocks}/discovery/nats/option.go (100%) rename {test/mocks => mocks}/discovery/nats/option_func.go (100%) rename {test/mocks => mocks}/discovery/provider.go (100%) rename {test/mocks => mocks}/hash/hasher.go (100%) rename {test/mocks => mocks}/internal/v1/internalpbconnect/remoting_service_client.go (100%) rename {test/mocks => mocks}/internal/v1/internalpbconnect/remoting_service_handler.go (100%) diff --git a/.codecov.yml b/.codecov.yml index e10d3a50..8d898339 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -14,3 +14,4 @@ - "examples/**/*" - "internal/**/*" - "testkit/**/*" + - "mocks" diff --git a/Earthfile b/Earthfile index e29896d9..6127e875 100644 --- a/Earthfile +++ b/Earthfile @@ -46,7 +46,7 @@ mock: RUN mockery --all --dir discovery --recursive --keeptree --exported=true --with-expecter=true --inpackage=true --output ./mocks/discovery --case snake RUN mockery --all --dir cluster --recursive --keeptree --exported=true --with-expecter=true --inpackage=true --output ./mocks/cluster --case snake - SAVE ARTIFACT ./mocks mocks AS LOCAL test/mocks + SAVE ARTIFACT ./mocks mocks AS LOCAL mocks lint: diff --git a/actors/actor_system_test.go b/actors/actor_system_test.go index cdbac47a..4ba1455a 100644 --- a/actors/actor_system_test.go +++ b/actors/actor_system_test.go @@ -33,6 +33,8 @@ import ( "testing" "time" + testkit "github.com/tochemey/goakt/mocks/discovery" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -42,7 +44,6 @@ import ( eventspb "github.com/tochemey/goakt/pb/events/v1" "github.com/tochemey/goakt/telemetry" testpb "github.com/tochemey/goakt/test/data/pb/v1" - testkit "github.com/tochemey/goakt/test/mocks/discovery" "github.com/travisjeffery/go-dynaport" sdkmetric "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/metricdata" diff --git a/cluster/discovery_test.go b/cluster/discovery_test.go index 01ab78e9..2d0ad79e 100644 --- a/cluster/discovery_test.go +++ b/cluster/discovery_test.go @@ -28,12 +28,13 @@ import ( "fmt" "testing" + testkit "github.com/tochemey/goakt/mocks/discovery" + "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/tochemey/goakt/discovery" "github.com/tochemey/goakt/discovery/kubernetes" "github.com/tochemey/goakt/log" - testkit "github.com/tochemey/goakt/test/mocks/discovery" "github.com/travisjeffery/go-dynaport" ) diff --git a/cluster/hasher_test.go b/cluster/hasher_test.go index 9d1584b0..c4edce78 100644 --- a/cluster/hasher_test.go +++ b/cluster/hasher_test.go @@ -27,8 +27,9 @@ package cluster import ( "testing" + testkit "github.com/tochemey/goakt/mocks/hash" + "github.com/stretchr/testify/assert" - testkit "github.com/tochemey/goakt/test/mocks/hash" ) func TestHasher(t *testing.T) { diff --git a/cluster/node_test.go b/cluster/node_test.go index 37bf0721..9322af3c 100644 --- a/cluster/node_test.go +++ b/cluster/node_test.go @@ -32,6 +32,8 @@ import ( "testing" "time" + testkit "github.com/tochemey/goakt/mocks/discovery" + "github.com/google/uuid" natsserver "github.com/nats-io/nats-server/v2/server" "github.com/stretchr/testify/assert" @@ -41,7 +43,6 @@ import ( internalpb "github.com/tochemey/goakt/internal/v1" "github.com/tochemey/goakt/log" eventspb "github.com/tochemey/goakt/pb/events/v1" - testkit "github.com/tochemey/goakt/test/mocks/discovery" "github.com/travisjeffery/go-dynaport" "google.golang.org/protobuf/proto" ) diff --git a/cluster/option_test.go b/cluster/option_test.go index 37af6eeb..91c522a1 100644 --- a/cluster/option_test.go +++ b/cluster/option_test.go @@ -28,9 +28,10 @@ import ( "testing" "time" + testkit "github.com/tochemey/goakt/mocks/hash" + "github.com/stretchr/testify/assert" "github.com/tochemey/goakt/log" - testkit "github.com/tochemey/goakt/test/mocks/hash" ) func TestOptions(t *testing.T) { diff --git a/test/mocks/cluster/interface.go b/mocks/cluster/interface.go similarity index 100% rename from test/mocks/cluster/interface.go rename to mocks/cluster/interface.go diff --git a/test/mocks/cluster/option.go b/mocks/cluster/option.go similarity index 100% rename from test/mocks/cluster/option.go rename to mocks/cluster/option.go diff --git a/test/mocks/cluster/option_func.go b/mocks/cluster/option_func.go similarity index 100% rename from test/mocks/cluster/option_func.go rename to mocks/cluster/option_func.go diff --git a/test/mocks/discovery/nats/option.go b/mocks/discovery/nats/option.go similarity index 100% rename from test/mocks/discovery/nats/option.go rename to mocks/discovery/nats/option.go diff --git a/test/mocks/discovery/nats/option_func.go b/mocks/discovery/nats/option_func.go similarity index 100% rename from test/mocks/discovery/nats/option_func.go rename to mocks/discovery/nats/option_func.go diff --git a/test/mocks/discovery/provider.go b/mocks/discovery/provider.go similarity index 100% rename from test/mocks/discovery/provider.go rename to mocks/discovery/provider.go diff --git a/test/mocks/hash/hasher.go b/mocks/hash/hasher.go similarity index 100% rename from test/mocks/hash/hasher.go rename to mocks/hash/hasher.go diff --git a/test/mocks/internal/v1/internalpbconnect/remoting_service_client.go b/mocks/internal/v1/internalpbconnect/remoting_service_client.go similarity index 100% rename from test/mocks/internal/v1/internalpbconnect/remoting_service_client.go rename to mocks/internal/v1/internalpbconnect/remoting_service_client.go diff --git a/test/mocks/internal/v1/internalpbconnect/remoting_service_handler.go b/mocks/internal/v1/internalpbconnect/remoting_service_handler.go similarity index 100% rename from test/mocks/internal/v1/internalpbconnect/remoting_service_handler.go rename to mocks/internal/v1/internalpbconnect/remoting_service_handler.go