From ec11ca51e564f75f074e18c8590708de1f2d786d Mon Sep 17 00:00:00 2001 From: Anton Sattarov <sattarov@perx.ru> Date: Thu, 27 Jul 2023 10:30:38 +0300 Subject: [PATCH] remove MigrateOptions.Wait --- pkg/setup/setup_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/setup/setup_test.go b/pkg/setup/setup_test.go index 6a1b6f7b..a4084a17 100644 --- a/pkg/setup/setup_test.go +++ b/pkg/setup/setup_test.go @@ -10,7 +10,6 @@ import ( collectionMock "git.perx.ru/perxis/perxis-go/pkg/collections/mocks" "git.perx.ru/perxis/perxis-go/pkg/content" "git.perx.ru/perxis/perxis-go/pkg/data" - "git.perx.ru/perxis/perxis-go/pkg/environments" environmentMock "git.perx.ru/perxis/perxis-go/pkg/environments/mocks" "git.perx.ru/perxis/perxis-go/pkg/errors" "git.perx.ru/perxis/perxis-go/pkg/extension" @@ -102,7 +101,7 @@ func TestSetupInstall(t *testing.T) { t.Run("Success, no force", func(t *testing.T) { envMocks := &environmentMock.Environments{} - envMocks.On("Migrate", mock.Anything, spaceID, envID, &environments.MigrateOptions{Wait: true}). + envMocks.On("Migrate", mock.Anything, spaceID, envID). Return(nil). Once() @@ -180,7 +179,7 @@ func TestSetupInstall(t *testing.T) { t.Run("Success, update existing records", func(t *testing.T) { envMocks := &environmentMock.Environments{} //todo после удаления флага _alwaysSetSchema убрать лишний вызов - envMocks.On("Migrate", mock.Anything, spaceID, envID, &environments.MigrateOptions{Wait: true}). + envMocks.On("Migrate", mock.Anything, spaceID, envID). Return(nil).Once() collsMock := &collectionMock.Collections{} @@ -247,7 +246,7 @@ func TestSetupInstall(t *testing.T) { t.Run("Success, with force", func(t *testing.T) { //todo после удаления флага _alwaysSetSchema убрать лишний вызов envMocks := &environmentMock.Environments{} - envMocks.On("Migrate", mock.Anything, spaceID, envID, &environments.MigrateOptions{Wait: true}). + envMocks.On("Migrate", mock.Anything, spaceID, envID). Return(nil).Once() collsMock := &collectionMock.Collections{} @@ -552,7 +551,7 @@ func TestSetupInstall(t *testing.T) { t.Run("Can't migrate, storage returns error", func(t *testing.T) { envMocks := &environmentMock.Environments{} - envMocks.On("Migrate", mock.Anything, spaceID, envID, &environments.MigrateOptions{Wait: true}). + envMocks.On("Migrate", mock.Anything, spaceID, envID). Return(errors.New("can't migrate")). Once() @@ -612,7 +611,7 @@ func TestSetupInstall(t *testing.T) { t.Run("Can't find action, storage returns error", func(t *testing.T) { envMocks := &environmentMock.Environments{} - envMocks.On("Migrate", mock.Anything, spaceID, envID, &environments.MigrateOptions{Wait: true}). + envMocks.On("Migrate", mock.Anything, spaceID, envID). Return(nil). Once() -- GitLab