diff --git a/server/.golangci.yml b/server/.golangci.yml index 82066925d1..f11ca30ff8 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -117,7 +117,6 @@ issues: channels/app/platform/web_conn.go|\ channels/app/platform/web_hub.go|\ channels/app/platform/web_hub_test.go|\ - channels/app/plugin_api_tests/test_update_user_auth_plugin/main.go|\ channels/app/plugin_install.go|\ channels/app/plugin_signature.go|\ channels/app/plugin_signature_test.go|\ diff --git a/server/channels/app/plugin_api_tests/test_update_user_auth_plugin/main.go b/server/channels/app/plugin_api_tests/test_update_user_auth_plugin/main.go index dd83b3d891..df7e9a4a53 100644 --- a/server/channels/app/plugin_api_tests/test_update_user_auth_plugin/main.go +++ b/server/channels/app/plugin_api_tests/test_update_user_auth_plugin/main.go @@ -24,7 +24,7 @@ func (p *MyPlugin) OnConfigurationChange() error { } func (p *MyPlugin) expectUserAuth(userID string, expectedUserAuth *model.UserAuth) error { - user, err := p.API.GetUser(p.configuration.BasicUserID) + user, err := p.API.GetUser(userID) if err != nil { return err } @@ -63,21 +63,33 @@ func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model return nil, appErr.Error() } - p.expectUserAuth(p.configuration.BasicUserID, expectedUserAuth) - p.expectUserAuth(p.configuration.BasicUser2Id, expectedUser2Auth) + err := p.expectUserAuth(p.configuration.BasicUserID, expectedUserAuth) + if err != nil { + return nil, err.Error() + } + err = p.expectUserAuth(p.configuration.BasicUser2Id, expectedUser2Auth) + if err != nil { + return nil, err.Error() + } // Update BasicUser to LDAP expectedUserAuth = &model.UserAuth{ AuthService: model.UserAuthServiceLdap, AuthData: model.NewPointer("ldap_auth_data"), } - _, err := p.API.UpdateUserAuth(p.configuration.BasicUserID, expectedUserAuth) + _, appErr = p.API.UpdateUserAuth(p.configuration.BasicUserID, expectedUserAuth) + if appErr != nil { + return nil, appErr.Error() + } + + err = p.expectUserAuth(p.configuration.BasicUserID, expectedUserAuth) + if err != nil { + return nil, err.Error() + } + err = p.expectUserAuth(p.configuration.BasicUser2Id, expectedUser2Auth) if err != nil { return nil, err.Error() } - - p.expectUserAuth(p.configuration.BasicUserID, expectedUserAuth) - p.expectUserAuth(p.configuration.BasicUser2Id, expectedUser2Auth) return nil, "OK" }