From 262c4c5d95a0c6cf1f1b7f2279bd5ec69b0d7036 Mon Sep 17 00:00:00 2001 From: Romain LE JEUNE Date: Thu, 25 May 2023 09:12:15 +0200 Subject: [PATCH] fix(GODT-2437): Fix test + bump Gluon with silenced report. --- go.mod | 2 +- go.sum | 4 ++-- internal/bridge/user_event_test.go | 2 -- internal/bridge/user_test.go | 6 ------ 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0d530e44..3d693da8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557 github.com/Masterminds/semver/v3 v3.2.0 - github.com/ProtonMail/gluon v0.16.1-0.20230524053752-395f1bc10a44 + github.com/ProtonMail/gluon v0.16.1-0.20230525065316-a08bb823bbca github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a github.com/ProtonMail/go-proton-api v0.4.1-0.20230523092337-ea8de5f674b7 github.com/ProtonMail/gopenpgp/v2 v2.7.1-proton diff --git a/go.sum b/go.sum index 23fde3cc..5e5078df 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo= github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk= github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g= -github.com/ProtonMail/gluon v0.16.1-0.20230524053752-395f1bc10a44 h1:Co04eLC3cZcZ3VW7FLou/BG3MiSeuJIozJRPwemg6H8= -github.com/ProtonMail/gluon v0.16.1-0.20230524053752-395f1bc10a44/go.mod h1:ERZikuN+2i/oTeSwS5fq7J0Fms76uUcBlTAwT4KaEAk= +github.com/ProtonMail/gluon v0.16.1-0.20230525065316-a08bb823bbca h1:EPTH1Qi8QsW6PC0FMvI9s33UZ1bYSrPPiUIoYrUY0XY= +github.com/ProtonMail/gluon v0.16.1-0.20230525065316-a08bb823bbca/go.mod h1:ERZikuN+2i/oTeSwS5fq7J0Fms76uUcBlTAwT4KaEAk= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4= github.com/ProtonMail/go-crypto v0.0.0-20230321155629-9a39f2531310/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE= diff --git a/internal/bridge/user_event_test.go b/internal/bridge/user_event_test.go index e31ae675..48c559c2 100644 --- a/internal/bridge/user_event_test.go +++ b/internal/bridge/user_event_test.go @@ -76,8 +76,6 @@ func TestBridge_User_RefreshEvent(t *testing.T) { withBridge(ctx, t, s.GetHostURL(), netCtl, locator, storeKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) { syncCh, closeCh := chToType[events.Event, events.SyncFinished](bridge.GetEvents(events.SyncFinished{})) - mocks.Reporter.EXPECT().ReportMessageWithContext(gomock.Any(), gomock.Any()).MinTimes(1) - require.Equal(t, userID, (<-syncCh).UserID) closeCh() diff --git a/internal/bridge/user_test.go b/internal/bridge/user_test.go index d8767110..fe9532ef 100644 --- a/internal/bridge/user_test.go +++ b/internal/bridge/user_test.go @@ -28,10 +28,8 @@ import ( "github.com/ProtonMail/go-proton-api" "github.com/ProtonMail/go-proton-api/server" "github.com/ProtonMail/proton-bridge/v3/internal/bridge" - mocksPkg "github.com/ProtonMail/proton-bridge/v3/internal/bridge/mocks" "github.com/ProtonMail/proton-bridge/v3/internal/events" "github.com/ProtonMail/proton-bridge/v3/internal/vault" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) @@ -678,10 +676,6 @@ func TestBridge_UserInfo_Alias(t *testing.T) { func TestBridge_User_Refresh(t *testing.T) { withEnv(t, func(ctx context.Context, s *server.Server, netCtl *proton.NetCtl, locator bridge.Locator, vaultKey []byte) { withBridge(ctx, t, s.GetHostURL(), netCtl, locator, vaultKey, func(bridge *bridge.Bridge, mocks *bridge.Mocks) { - mocks.Reporter.EXPECT().ReportMessageWithContext( - gomock.Eq("Warning: refresh occurred"), - mocksPkg.NewRefreshContextMatcher(proton.RefreshAll), - ).Return(nil) // Get a channel of sync started events. syncStartCh, done := chToType[events.Event, events.SyncStarted](bridge.GetEvents(events.SyncStarted{}))