Fail tests if `ACCOUNT_PASSWORD` env var is not defined

This commit is contained in:
Pedro Pombeiro 2018-06-08 12:11:10 +02:00 committed by Pedro Pombeiro
parent d5be8c525d
commit 291ad8fa35
1 changed files with 6 additions and 1 deletions

View File

@ -297,7 +297,12 @@ func loadTestConfig() (*testConfig, error) {
return nil, err
}
pass := os.Getenv(passphraseEnvName)
pass, ok := os.LookupEnv(passphraseEnvName)
if !ok {
err := fmt.Errorf("Missing %s environment variable", passphraseEnvName)
return nil, err
}
config.Account1.Password = pass
config.Account2.Password = pass
}