thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
MIT License
2.98k stars 799 forks source link

Postrges test fails consistently #567

Open Rots opened 3 years ago

Rots commented 3 years ago

New Issue

Context

Expected Behavior

Running go tests locally pass. If the target environment is not available for some tests, they should be skipped.

Current Behavior

tests consistently fail

Failure Information (for bugs)

make test fails

Steps to Reproduce / Failure Logs

gocryptotrader$ go test -v ./database/models/postgres/
Unable to execute setup: parameter validation failed:
        Parameter is an empty string: psql.user
        Parameter is an empty string: psql.host
        Parameter is an empty string: psql.dbname
FAIL    github.com/thrasher-corp/gocryptotrader/database/models/postgres        0.005s
FAIL
xtda commented 3 years ago

yeah this is caused by it looking for either sqlboiler.json or env vars on start up due to usage of viper

there are a few other minor issues with the template generation from our fork of sqlboiler such as a few of the other tests it will generate with FK relations will always fail and style related

I have been meaning to go through and update the fork to keep it inline with master I think in the end i ended up finding local workrounds for almost all the issues besides one migration related so shouldn't be that much of an issue to keep it inline and also apply a fix to skip tests a lot more will get on it at some point this week hopefully