Skip to content

Commit 63515cd

Browse files
Test syntax (#6)
LGTM
1 parent 2dbd686 commit 63515cd

File tree

107 files changed

+408
-2679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+408
-2679
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
.idea
77
.vscode
8+
9+
/policyTester

pkg/tester/runner.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
"github.com/stretchr/testify/require"
1717
)
1818

19-
const tfOutputPolicyAssignmentName = "policy_assignment_name"
20-
2119
type testRunner struct {
2220
tfExecPath string
2321
config TestConfig
@@ -54,24 +52,18 @@ func (runner *testRunner) Test(t *testing.T) {
5452
outputs, err := setup.Output(ctx)
5553
require.NoError(t, err, "setup: error running Output command")
5654

57-
var pan string
58-
require.NoErrorf(t, json.Unmarshal(outputs[tfOutputPolicyAssignmentName].Value, &pan), "setup: unmarshall value of %s from the outputs", tfOutputPolicyAssignmentName)
59-
6055
errorMessagesExpectedParts := []string{
6156
runner.config.ErrorMessage,
6257
runner.config.ErrorCode,
63-
pan,
6458
}
6559

6660
vars := make([]*tfexec.VarOption, 0)
6761

6862
for key, output := range outputs {
69-
if key != tfOutputPolicyAssignmentName {
70-
var value string
71-
require.NoErrorf(t, json.Unmarshal(output.Value, &value), "setup: unmarshall value of %s from the outputs", key)
63+
var value string
64+
require.NoErrorf(t, json.Unmarshal(output.Value, &value), "setup: unmarshall value of %s from the outputs", key)
7265

73-
vars = append(vars, tfexec.Var(fmt.Sprintf("%s=%v", key, value)))
74-
}
66+
vars = append(vars, tfexec.Var(fmt.Sprintf("%s=%v", key, value)))
7567
}
7668

7769
time.Sleep(30 * time.Minute) // Time for the policy to be active

policy_definitions/appgateway-naming/definition.tf

Lines changed: 0 additions & 42 deletions
This file was deleted.

policy_definitions/appgateway-naming/output.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

policy_definitions/appgateway-naming/variables.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

policy_definitions/applicationsecuritygroup-naming/definition.tf

Lines changed: 0 additions & 42 deletions
This file was deleted.

policy_definitions/applicationsecuritygroup-naming/output.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

policy_definitions/applicationsecuritygroup-naming/variables.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

policy_definitions/diskencryptionset-naming/definition.tf

Lines changed: 0 additions & 42 deletions
This file was deleted.

policy_definitions/diskencryptionset-naming/output.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)