Skip to content

Tests panic with following command #150

@Dragomir-Ivanov

Description

@Dragomir-Ivanov
go test ./... -count 10 -p 1 -run Test_BasicEndToEnd
{"@timestamp":"2019-11-24T13:45:40.554779999-08:00","@version":"1","level":"warning","message":"DEPRECATED: '-backend' is no longer supported. Please set the backends by explicit parameters"}
{"@timestamp":"2019-11-24T13:45:40.555117901-08:00","@version":"1","Backends":{"simple":{"bob":"secret"}},"CookieDomain":"","CookieExpiry":0,"CookieHTTPOnly":true,"CookieName":"jwt_token","CookieSecure":true,"GracePeriod":5000000000,"Host":"localhost","JwtAlgo":"HS512","JwtExpiry":86400000000000,"JwtRefreshes":0,"JwtSecret":"...","JwtSecretFile":"","LogLevel":"info","LoginPath":"/login","LogoutURL":"","Oauth":{},"Port":"3000","Redirect":true,"RedirectCheckReferer":true,"RedirectHostFile":"","RedirectQueryParameter":"backTo","SuccessURL":"/","Template":"","TextLogging":false,"UserEndpoint":"","UserEndpointTimeout":5000000000,"UserEndpointToken":"","UserFile":"","event":"start","level":"info","message":"starting application: loginsrv","type":"lifecycle"}
{"@timestamp":"2019-11-24T13:45:41.556961414-08:00","@version":"1","correlation_id":"Pusj3FC0EI","level":"info","message":"successfully authenticated","type":"application","username":"bob"}
{"@timestamp":"2019-11-24T13:45:41.557337806-08:00","@version":"1","User_Agent":"Go-http-client/1.1","correlation_id":"Pusj3FC0EI","duration":0,"host":"localhost:3000","level":"info","message":"200 -\u003ePOST /login","method":"POST","proto":"HTTP/1.1","remote_ip":"127.0.0.1","response_status":200,"type":"access","url":"/login"}
/tmp/go-build719816027/b001/loginsrv.test flag redefined: host
panic: /tmp/go-build719816027/b001/loginsrv.test flag redefined: host

goroutine 26 [running]:
flag.(*FlagSet).Var(0xc0000a6120, 0x99cf00, 0xc000089980, 0x8f37f3, 0x4, 0x8fdec0, 0x15)
	/usr/local/go/src/flag/flag.go:848 +0x4ae
flag.(*FlagSet).StringVar(...)
	/usr/local/go/src/flag/flag.go:751
github.com/tarent/loginsrv/login.(*Config).ConfigureFlagSet(0xc000089980, 0xc0000a6120)
	/home/drago/loginsrv/login/config.go:132 +0x71
github.com/tarent/loginsrv/login.readConfig(0xc0000a6120, 0xc0000a6c10, 0x5, 0x5, 0x0, 0x0, 0x0)
	/home/drago/loginsrv/login/config.go:212 +0x2bd
github.com/tarent/loginsrv/login.ReadConfig(...)
	/home/drago/loginsrv/login/config.go:202
github.com/tarent/loginsrv.main()
	/home/drago/loginsrv/main.go:23 +0x89
created by github.com/tarent/loginsrv.Test_BasicEndToEnd
	/home/drago/loginsrv/main_test.go:22 +0x157
FAIL	github.com/tarent/loginsrv	1.009s
ok  	github.com/tarent/loginsrv/caddy	0.003s [no tests to run]
?   	github.com/tarent/loginsrv/caddy/demo	[no test files]
ok  	github.com/tarent/loginsrv/htpasswd	0.004s [no tests to run]
ok  	github.com/tarent/loginsrv/httpupstream	0.003s [no tests to run]
ok  	github.com/tarent/loginsrv/logging	0.002s [no tests to run]
ok  	github.com/tarent/loginsrv/login	0.003s [no tests to run]
ok  	github.com/tarent/loginsrv/model	0.004s [no tests to run]
ok  	github.com/tarent/loginsrv/oauth2	0.002s [no tests to run]
ok  	github.com/tarent/loginsrv/osiam	0.003s [no tests to run]
FAIL

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