xenon
xenon copied to clipboard
[question] I meet some errors when I run make test
The test case errors I met like next, should I need to do some configraion before I run make test?:
On Mac:
=== RUN TestNormalTicker
--- FAIL: TestNormalTicker (0.10s)
Error Trace: common_test.go:83
Error: Not equal:
expected: 1
received: 0
=== RUN TestRunCommandWithTimeout
--- PASS: TestRunCommandWithTimeout (1.01s)
=== RUN TestRunCommand
--- PASS: TestRunCommand (0.01s)
=== RUN TestCommand
--- FAIL: TestCommand (0.04s)
Error Trace: linux_test.go:60
Error: Expected nil, but got: cmd.outs.[sleep: missing operand].found[0]!=expects[1]
FAIL
FAIL xbase/common 1.703s
make[1]: *** [testcommon] Error 1
make: *** [test] Error 2
On linux:
=== RUN TestCLIInitCommand
init.go:58: unexpected error: getEth[192.168.0.14].can.not.found.eth
2019/03/22 10:07:01.832637 [PANIC] getEth[192.168.0.14].can.not.found.eth
--- FAIL: TestCLIInitCommand (0.01s)
panic: [PANIC] getEth[192.168.0.14].can.not.found.eth [recovered]
panic: [PANIC] getEth[192.168.0.14].can.not.found.eth
goroutine 404 [running]:
testing.tRunner.func1(0xc4201ae5a0)
/usr/lib/go-1.10/src/testing/testing.go:742 +0x29d
panic(0x822f80, 0xc42032a990)
/usr/lib/go-1.10/src/runtime/panic.go:502 +0x229
xbase/xlog.(*Log).Panic(0xc4200a3f90, 0x8ce9fc, 0x2, 0xc420269b50, 0x1, 0x1)
/home/ubuntu/github/xenon/src/xbase/xlog/xlog.go:142 +0x190
cli/cmd.ErrorOK(0x92d3e0, 0xc42032a950)
/home/ubuntu/github/xenon/src/cli/cmd/common.go:35 +0x222
cli/cmd.initCommandFn(0xc420274000, 0xc4202e64d0, 0x1, 0xb)
/home/ubuntu/github/xenon/src/cli/cmd/init.go:58 +0x88
vendor/github.com/spf13/cobra.(*Command).execute(0xc420274000, 0xc4202e6420, 0xb, 0xb, 0xc420274000, 0xc4202e6420)
/home/ubuntu/github/xenon/src/vendor/github.com/spf13/cobra/command.go:603 +0x234
vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420274000, 0xc42032a8a0, 0x8d1e80, 0xc42025cec0)
/home/ubuntu/github/xenon/src/vendor/github.com/spf13/cobra/command.go:689 +0x2d4
cli/cmd.executeCommand(0xc420274000, 0xc4202e6420, 0xb, 0xb, 0x0, 0x0, 0x0, 0x1)
/home/ubuntu/github/xenon/src/cli/cmd/common.go:101 +0xda
cli/cmd.TestCLIInitCommand(0xc4201ae5a0)
/home/ubuntu/github/xenon/src/cli/cmd/init_test.go:27 +0x179
testing.tRunner(0xc4201ae5a0, 0x8f51d8)
/usr/lib/go-1.10/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
/usr/lib/go-1.10/src/testing/testing.go:824 +0x2e0
FAIL cli/cmd 0.796s
makefile:56: recipe for target 'testcli' failed
make[1]: *** [testcli] Error 1
make[1]: Leaving directory '/home/ubuntu/github/xenon'
makefile:28: recipe for target 'test' failed
make: *** [test] Error 2