Skip to content

make test errors with nil pointer dereference #1

@threez

Description

@threez

Here the backend errors on initialization are ignored. Which causes make testto fail like this:

go test ./...
?       github.com/UserStack/ustackweb  [no test files]
?       github.com/UserStack/ustackweb/backend  [no test files]
?       github.com/UserStack/ustackweb/controllers  [no test files]
?       github.com/UserStack/ustackweb/models   [no test files]
?       github.com/UserStack/ustackweb/routers  [no test files]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4351b44]

goroutine 16 [running]:
runtime.panic(0x4686640, 0x4a61004)
    /usr/local/opt/go/libexec/src/pkg/runtime/panic.c:279 +0xf5
github.com/UserStack/ustackd/client.(*Client).CreateUser(0x0, 0x470e750, 0x5, 0x470e750, 0x5, 0x0, 0x0)
    /Users/threez/Development/go/src/github.com/UserStack/ustackd/client/client.go:94 +0x2a4
github.com/UserStack/ustackweb/models.(*UserCollection).Create(0xc2081229e0, 0x470e750, 0x5, 0x470e750, 0x5, 0x0, 0xc2080041e0)
    /Users/threez/Development/go/src/github.com/UserStack/ustackweb/models/user_collection.go:39 +0x6c
github.com/UserStack/ustackweb/tests.init·1()
    /Users/threez/Development/go/src/github.com/UserStack/ustackweb/tests/default_test.go:25 +0x145
github.com/UserStack/ustackweb/tests.init()
    /Users/threez/Development/go/src/github.com/UserStack/ustackweb/tests/default_test.go:144 +0x8c
main.init()
    github.com/UserStack/ustackweb/tests/_test/_testmain.go:48 +0x46

goroutine 19 [finalizer wait]:
runtime.park(0x40ccdd0, 0x4a7aa50, 0x4a65709)
    /usr/local/opt/go/libexec/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x4a7aa50, 0x4a65709)
    /usr/local/opt/go/libexec/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/local/opt/go/libexec/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/local/opt/go/libexec/src/pkg/runtime/proc.c:1445

goroutine 20 [chan receive]:
github.com/astaxie/beego/logs.(*BeeLogger).startLogger(0xc208023740)
    /Users/threez/Development/go/src/github.com/astaxie/beego/logs/log.go:194 +0x70
created by github.com/astaxie/beego/logs.NewLogger
    /Users/threez/Development/go/src/github.com/astaxie/beego/logs/log.go:114 +0x9a
FAIL    github.com/UserStack/ustackweb/tests    0.081s
?       github.com/UserStack/ustackweb/utils    [no test files]
make: *** [test] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions