Validate required env vars not-empty for Acceptance tests
This commit is contained in:
parent
846a39d7be
commit
0d7ec44895
1 changed files with 2 additions and 2 deletions
|
|
@ -108,7 +108,7 @@ type missingEnvError struct {
|
|||
}
|
||||
|
||||
func (e missingEnvError) Error() string {
|
||||
return fmt.Sprintf("missing environment variables: %s", strings.Join(e.missingEnvs, ", "))
|
||||
return fmt.Sprintf("environment variables %s must be set and non-empty", strings.Join(e.missingEnvs, ", "))
|
||||
}
|
||||
|
||||
type testScriptEnv struct {
|
||||
|
|
@ -129,7 +129,7 @@ func (e *testScriptEnv) fromEnv() error {
|
|||
var missingEnvs []string
|
||||
for _, key := range requiredEnvVars {
|
||||
val, ok := os.LookupEnv(key)
|
||||
if !ok {
|
||||
if val == "" || !ok {
|
||||
missingEnvs = append(missingEnvs, key)
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue