Compiling from source not using Docker; in loraserver:
make dev-requirements ran correctly
make requirements ran fine (after some work)
make test failed at:
0 0x0000000000d7652f in github.com/brocaar/loraserver/internal/test.(*DatabaseTestSuiteBase).SetupSuite
at /home/martin/Dropbox/go/src/github.com/brocaar/loraserver/internal/test/test.go:373
1 0x0000000000da2b01 in github.com/brocaar/loraserver/internal/api.(*NetworkServerAPITestSuite).SetupSuite
at ./network_server_new_test.go:31
db, err := common.OpenDatabase(conf.PostgresDSN)
conf.PostgresDSN is “postgres://localhost/loraserver_ns_test?sslmode=disable”
To my understanding this means open loraserver_ns_test database with user postgres, no password, and no sslmode.
I believe this was configured at line 63 of test/test.go
c := &Config{
RedisURL: "redis://localhost:6379",
PostgresDSN: "postgres://localhost/loraserver_ns_test?sslmode=disable",
}
When I look at the err returned, I see:
Message: “password authentication failed for user “martin””
Not sure why the user is martin and not postgres. Irrespective, I don’t have a loraserver_ns_test data base, and didn’t see docs to make one. Would I be better to add a new database or should I change test.go’s GetConfig() function to a database I have. I worry about having a database without a password; is this safe.
I do have a configuration file in: $HOME/.config/loraserver/loraserver.toml as documented in:
https://www.loraserver.io/loraserver/install/config/
and it has a line:
dsn=“user=loraserver dbname=loraserver password=my_password sslmode=disable”
Shouldn’t this configuration file be used during testing?
After changing line 63 in test/test.go to:
PostgresDSN: “user=loraserver dbname=loraserver password=anlg4all sslmode=disable”,
the test passed for >go test in loraserver/internal/api
Summary: I think I understand the error, but I don’t understand how best to do configuration to be used during >make test for loraserver (and for the other programs). Can we set up the configuration environment so it is used by all of the >make test programs? Thank you for your help.