forked from Azure/AgentBaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuite_config.go
More file actions
36 lines (31 loc) · 793 Bytes
/
suite_config.go
File metadata and controls
36 lines (31 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package e2e_test
import (
"fmt"
"os"
)
type suiteConfig struct {
subscription string
location string
resourceGroupName string
scenariosToRun map[string]bool
}
func newSuiteConfig() (*suiteConfig, error) {
var environment = map[string]string{
"SUBSCRIPTION_ID": "",
"LOCATION": "",
"RESOURCE_GROUP_NAME": "",
}
for k := range environment {
value := os.Getenv(k)
if value == "" {
return nil, fmt.Errorf("missing required environment variable %q", k)
}
environment[k] = value
}
return &suiteConfig{
subscription: environment["SUBSCRIPTION_ID"],
location: environment["LOCATION"],
resourceGroupName: environment["RESOURCE_GROUP_NAME"],
scenariosToRun: strToBoolMap(os.Getenv("SCENARIOS_TO_RUN")),
}, nil
}