Skip to content

Commit 10b0819

Browse files
authored
test: moved agent tags config into test option setup (#86)
1 parent 0378b5e commit 10b0819

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/pr_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ var ignoreUpdates = []string{
2121

2222
var sharedInfoSvc *cloudinfo.CloudInfoService
2323

24+
var logDNATagsList = []string{"tag1", "tag2"}
25+
2426
// TestMain will be run before any parallel tests, used to set up a shared InfoService object to track region usage
2527
// for multiple tests
2628
func TestMain(m *testing.M) {
@@ -35,6 +37,9 @@ func setupOptions(t *testing.T, prefix string, terraformDir string) *testhelper.
3537
TerraformDir: terraformDir,
3638
Prefix: prefix,
3739
ResourceGroup: resourceGroup,
40+
TerraformVars: map[string]interface{}{
41+
"logdna_agent_tags": logDNATagsList,
42+
},
3843
IgnoreUpdates: testhelper.Exemptions{
3944
List: ignoreUpdates,
4045
},
@@ -48,14 +53,8 @@ func setupOptions(t *testing.T, prefix string, terraformDir string) *testhelper.
4853
func TestRunBasicAgents(t *testing.T) {
4954
t.Parallel()
5055

51-
logDNATagsList := []string{"tag1", "tag2"}
52-
5356
options := setupOptions(t, "basic-obs-agents", terraformDirOther)
5457

55-
options.TerraformVars = map[string]interface{}{
56-
"logdna_agent_tags": logDNATagsList,
57-
}
58-
5958
output, err := options.RunTestConsistency()
6059
assert.Nil(t, err, "This should not have errored")
6160
assert.NotNil(t, output, "Expected some output")

0 commit comments

Comments
 (0)