Skip to content

Commit

Permalink
fix: fixing failed tests of v3 pluings
Browse files Browse the repository at this point in the history
  • Loading branch information
xpunch committed Apr 16, 2022
1 parent 7d35088 commit 0f6a645
Show file tree
Hide file tree
Showing 795 changed files with 566 additions and 139,706 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fmt:
@sh scripts/fmt.sh

mod:
@sh scripts/deps.sh

test:
@sh scripts/tests.sh
7 changes: 7 additions & 0 deletions scripts/fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -ex

for d in $(find * -name 'go.mod'); do
pushd $(dirname $d)
go fmt
popd
done
23 changes: 17 additions & 6 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
#!/bin/bash -e

for d in $(find * -name 'go.mod'); do
for d in $(find 'v3' -name 'go.mod'); do
case $(dirname $d) in
'v4/config/source/configmap'|'v4/config/source/vault'|'v4/events/redis'|'v4/logger/windowseventlog'|'v4/store/mysql'|'v4/store/redis'|'v4/sync/consul'|'v4/sync/etcd'|'v3/config/source/configmap'|'v3/config/source/vault'|'v3/events/redis'|'v3/logger/windowseventlog'|'v3/store/mysql'|'v3/store/redis'|'v3/sync/consul'|'v3/sync/etcd')
echo skip $(dirname $d)
'v3/config/source/configmap'|'v3/config/source/vault'|'v3/events/redis'|'v3/logger/apex'|'v3/logger/windowseventlog'|'v3/store/mysql'|'v3/store/redis'|'v3/store/memory'|'v3/store/file'|'v3/sync/consul'|'v3/sync/etcd')
echo SKIP $(dirname $d)
;;
*)
pushd $(dirname $d) >/dev/null
go get
go vet
#go test -race -v
go test -v
go test
popd >/dev/null
esac
done

for d in $(find 'v4' -name 'go.mod'); do
case $(dirname $d) in
'v4/config/source/configmap'|'v4/config/source/vault'|'v4/events/redis'|'v4/events/natsjs'|'v4/logger/windowseventlog'|'v4/store/mysql'|'v4/store/redis'|'v4/sync/consul'|'v4/sync/etcd')
echo SKIP $(dirname $d)
;;
*)
pushd $(dirname $d) >/dev/null
go vet
go test # -race
popd >/dev/null
esac
done
3 changes: 3 additions & 0 deletions v3/auth/jwt/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asim/go-micro/v3 v3.7.1 h1:PCdAOFjSaG5LRulccEApGypMQMg4D7AGqaSd07/uo7k=
github.com/asim/go-micro/v3 v3.7.1/go.mod h1:GP48EHjG/7dw16ZL+lflu2S2SXSPKEVE2mPc45URs1E=
github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -484,7 +485,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
Expand Down
2 changes: 1 addition & 1 deletion v3/auth/jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/asim/go-micro/v3/auth"
"github.com/asim/go-micro/v3/cmd"
jwtToken "github.com/go-micro/plugins/v3/auth/jwt/v3/token"
jwtToken "github.com/go-micro/plugins/v3/auth/jwt/token"
)

func init() {
Expand Down
3 changes: 3 additions & 0 deletions v3/broker/gocloud/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asim/go-micro/v3 v3.7.1 h1:PCdAOFjSaG5LRulccEApGypMQMg4D7AGqaSd07/uo7k=
github.com/asim/go-micro/v3 v3.7.1/go.mod h1:GP48EHjG/7dw16ZL+lflu2S2SXSPKEVE2mPc45URs1E=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
Expand Down Expand Up @@ -534,7 +535,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
Expand Down
3 changes: 3 additions & 0 deletions v3/broker/googlepubsub/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asim/go-micro/v3 v3.7.1 h1:PCdAOFjSaG5LRulccEApGypMQMg4D7AGqaSd07/uo7k=
github.com/asim/go-micro/v3 v3.7.1/go.mod h1:GP48EHjG/7dw16ZL+lflu2S2SXSPKEVE2mPc45URs1E=
github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -546,7 +547,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
Expand Down
2 changes: 1 addition & 1 deletion v3/broker/googlepubsub/googlepubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"time"

"cloud.google.com/go/pubsub"
"github.com/google/uuid"
"github.com/asim/go-micro/v3/broker"
"github.com/asim/go-micro/v3/cmd"
log "github.com/asim/go-micro/v3/logger"
"github.com/google/uuid"
"google.golang.org/api/option"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
3 changes: 3 additions & 0 deletions v3/broker/grpc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asim/go-micro/v3 v3.7.1 h1:PCdAOFjSaG5LRulccEApGypMQMg4D7AGqaSd07/uo7k=
github.com/asim/go-micro/v3 v3.7.1/go.mod h1:GP48EHjG/7dw16ZL+lflu2S2SXSPKEVE2mPc45URs1E=
github.com/aws/aws-sdk-go v1.37.27/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -495,7 +496,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
Expand Down
2 changes: 1 addition & 1 deletion v3/broker/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
maddr "github.com/asim/go-micro/v3/util/addr"
mnet "github.com/asim/go-micro/v3/util/net"
mls "github.com/asim/go-micro/v3/util/tls"
proto "github.com/go-micro/plugins/v3/broker/grpc/v3/proto"
proto "github.com/go-micro/plugins/v3/broker/grpc/proto"
"github.com/google/uuid"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down
11 changes: 6 additions & 5 deletions v3/broker/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/asim/go-micro/v3/broker"
"github.com/asim/go-micro/v3/registry"
"github.com/google/uuid"
)

Expand Down Expand Up @@ -70,7 +71,7 @@ func sub(be *testing.B, c int) {

func pub(be *testing.B, c int) {
be.StopTimer()
m := memory.NewRegistry()
m := registry.NewMemoryRegistry()
b := NewBroker(broker.Registry(m))
topic := uuid.New().String()

Expand Down Expand Up @@ -111,7 +112,7 @@ func pub(be *testing.B, c int) {
go func() {
for _ = range ch {
if err := b.Publish(topic, msg); err != nil {
be.Fatalf("Unexpected publish error: %v", err)
be.Errorf("Unexpected publish error: %v", err)
}
select {
case <-done:
Expand Down Expand Up @@ -139,7 +140,7 @@ func pub(be *testing.B, c int) {
}

func TestBroker(t *testing.T) {
m := memory.NewRegistry()
m := registry.NewMemoryRegistry()
b := NewBroker(broker.Registry(m))

if err := b.Init(); err != nil {
Expand Down Expand Up @@ -185,7 +186,7 @@ func TestBroker(t *testing.T) {
}

func TestConcurrentSubBroker(t *testing.T) {
m := memory.NewRegistry()
m := registry.NewMemoryRegistry()
b := NewBroker(broker.Registry(m))

if err := b.Init(); err != nil {
Expand Down Expand Up @@ -242,7 +243,7 @@ func TestConcurrentSubBroker(t *testing.T) {
}

func TestConcurrentPubBroker(t *testing.T) {
m := memory.NewRegistry()
m := registry.NewMemoryRegistry()
b := NewBroker(broker.Registry(m))

if err := b.Init(); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions v3/broker/grpc/proto/broker.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions v3/broker/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import (
"sync"
"time"

"github.com/google/uuid"
"github.com/asim/go-micro/v3/broker"
"github.com/asim/go-micro/v3/codec/json"
"github.com/asim/go-micro/v3/cmd"
"github.com/asim/go-micro/v3/codec/json"
merr "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/registry"
"github.com/asim/go-micro/v3/registry/cache"
maddr "github.com/asim/go-micro/v3/util/addr"
mnet "github.com/asim/go-micro/v3/util/net"
mls "github.com/asim/go-micro/v3/util/tls"
"github.com/google/uuid"
"golang.org/x/net/http2"
)

Expand Down
Loading

0 comments on commit 0f6a645

Please sign in to comment.