Got insert testing in a better state

* Split up insert function for testing
* Add DBType to global state
* Move test reflection helpers to testing.go
* Add incremental seed to randomizeField to avoid duplicate constraint
  error messages
* Fixed Viper SSL default bug
* Fixed pgpass SSL inclusion bug
* Add MakeStringMap strmangle helper
* Change test errors from error to skip
This commit is contained in:
Patrick O'brien 2016-07-14 02:51:40 +10:00
parent f054f2f754
commit 4036786b6a
25 changed files with 778 additions and 781 deletions

View file

@ -119,6 +119,12 @@ func preRun(cmd *cobra.Command, args []string) error {
SSLMode: viper.GetString("postgres.sslmode"),
}
// Set the default SSLMode value
if cmdConfig.Postgres.SSLMode == "" {
viper.Set("postgres.sslmode", "require")
cmdConfig.Postgres.SSLMode = viper.GetString("postgres.sslmode")
}
err = vala.BeginValidation().Validate(
vala.StringNotEmpty(cmdConfig.Postgres.User, "postgres.user"),
vala.StringNotEmpty(cmdConfig.Postgres.Pass, "postgres.pass"),