From 61a06735507383a1c694d85800d7b546aa4a8db8 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 10 Apr 2022 19:16:12 +0800 Subject: [PATCH] fix unit test --- cmd/run.go | 2 ++ engine/user_test.go | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/cmd/run.go b/cmd/run.go index 28e0a141..60e617b0 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -20,6 +20,8 @@ var runCmd = &cobra.Command{ Short: L("Execute process"), Long: L("Execute process"), Run: func(cmd *cobra.Command, args []string) { + share.SessionServerStart() // Connect to session server + defer share.SessionServerStop() // Connect to session server defer gou.KillPlugins() defer func() { err := exception.Catch(recover()) diff --git a/engine/user_test.go b/engine/user_test.go index 4a05b208..1d86e97c 100644 --- a/engine/user_test.go +++ b/engine/user_test.go @@ -4,10 +4,16 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/yaoapp/yao/share" "github.com/yaoapp/yao/user" ) func TestUserAuth(t *testing.T) { + + // Start Session Server + share.SessionServerStart() + defer share.SessionServerStop() + res := user.Auth("email", "xiang@iqka.com", "A123456p+") assert.True(t, res.Has("user")) assert.True(t, res.Has("token"))