Skip to content

Commit

Permalink
utilize checkResultWithRetry func for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chilledornaments committed Dec 16, 2022
1 parent c308bf7 commit 7da6e5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/terraform/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ func TestFormatSetVarsAfterVarFilesFormatsCorrectly(t *testing.T) {
{[]string{"plan"}, map[string]interface{}{"foo": "bar"}, []string{"test.tfvars"}, false, []string{"plan", "-var", "foo=bar", "-var-file", "test.tfvars", "-lock=false"}},
}

for _, testCase := range testCases {
assert.Equal(t, testCase.expected, FormatArgs(&Options{SetVarsAfterVarFiles: testCase.setVarsAfterVarFiles, Vars: testCase.vars, VarFiles: testCase.varFiles}, testCase.command...))
for idx, testCase := range testCases {
checkResultWithRetry(t, 100, testCase.expected, fmt.Sprintf("FormatArgs(%d)", idx), func() interface{} {
return FormatArgs(&Options{SetVarsAfterVarFiles: testCase.setVarsAfterVarFiles, Vars: testCase.vars, VarFiles: testCase.varFiles}, testCase.command...)
})
}
}

0 comments on commit 7da6e5e

Please sign in to comment.