Skip to content

Commit

Permalink
fix visor_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifen committed Jan 24, 2020
1 parent c600438 commit 3868351
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/visor/visor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,18 @@ func TestNodeStartClose(t *testing.T) {
require.NoError(t, os.RemoveAll("skychat"))
}()

nodeCfg := Config{}
var (
nodeCfg = Config{}
logger = logging.MustGetLogger("test")
server = appserver.New(logger, nodeCfg.AppServerSockFile)
)

node := &Node{
conf: &nodeCfg,
router: r,
appsConf: apps,
logger: logging.MustGetLogger("test"),
conf: &nodeCfg,
router: r,
appsConf: apps,
logger: logger,
appRPCServer: server,
}

pm := &appserver.MockProcManager{}
Expand Down Expand Up @@ -210,7 +215,7 @@ func TestNodeSpawnApp(t *testing.T) {
pm.On("Wait", app.App).Return(testhelpers.NoErr)

appPID := appcommon.ProcID(10)
pm.On("Run", mock.Anything, appCfg, appArgs, mock.Anything, mock.Anything).
pm.On("Start", mock.Anything, appCfg, appArgs, mock.Anything, mock.Anything).
Return(appPID, testhelpers.NoErr)
pm.On("Exists", app.App).Return(true)
pm.On("Stop", app.App).Return(testhelpers.NoErr)
Expand Down Expand Up @@ -303,7 +308,7 @@ func TestNodeSpawnAppValidations(t *testing.T) {
appArgs := append([]string{filepath.Join(node.dir(), app.App)}, app.Args...)

appPID := appcommon.ProcID(10)
pm.On("Run", mock.Anything, appCfg, appArgs, mock.Anything, mock.Anything).
pm.On("Start", mock.Anything, appCfg, appArgs, mock.Anything, mock.Anything).
Return(appPID, appserver.ErrAppAlreadyStarted)
pm.On("Exists", app.App).Return(true)

Expand Down

0 comments on commit 3868351

Please sign in to comment.