Skip to content

Commit

Permalink
r/burn_alert: validation test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lafentres committed Nov 14, 2023
1 parent f138e8f commit fc06bdd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/provider/burn_alert_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func TestAcc_BurnAlertResource_validateBudgetRate(t *testing.T) {
dataset, sloID := burnAlertAccTestSetup(t)

budgetRateWindowMinutes := 60
budgetRateDecreasePercent := 1
budgetRateDecreasePercent := float64(1)

resource.Test(t, resource.TestCase{
PreCheck: testAccPreCheck(t),
Expand All @@ -262,13 +262,17 @@ func TestAcc_BurnAlertResource_validateBudgetRate(t *testing.T) {
ExpectError: regexp.MustCompile(`budget_rate_window_minutes value must be at least`),
},
{
Config: testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes, 0, dataset, sloID, "info"),
Config: testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes, float64(0), dataset, sloID, "info"),
ExpectError: regexp.MustCompile(`budget_rate_decrease_percent value must be at least`),
},
{
Config: testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes, 200, dataset, sloID, "info"),
Config: testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes, float64(200), dataset, sloID, "info"),
ExpectError: regexp.MustCompile(`budget_rate_decrease_percent value must be at most`),
},
{
Config: testAccConfigBurnAlertBudgetRate_basic(budgetRateWindowMinutes, float64(1.123456789), dataset, sloID, "info"),
ExpectError: regexp.MustCompile(`budget_rate_decrease_percent precision for value must be at most`),
},
{
Config: testAccConfigBurnAlertBudgetRate_validateAttributesWhenAlertTypeIsBudgetRate(dataset, sloID),
ExpectError: regexp.MustCompile(`argument "budget_rate_decrease_percent" is required`),
Expand Down

0 comments on commit fc06bdd

Please sign in to comment.