Skip to content

Commit 973671c

Browse files
nil pointer fix (#2308)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 3f91662 commit 973671c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

internal/resources/asserts/resource_alert_config_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ resource "grafana_asserts_notification_alerts_config" "test" {
209209
func TestAccAssertsAlertConfig_eventualConsistencyStress(t *testing.T) {
210210
testutils.CheckCloudInstanceTestsEnabled(t)
211211

212+
// Skip this flaky test unless explicitly enabled
213+
if !testutils.AccTestsEnabled("TF_ACC_STRESS_TESTS") {
214+
t.Skip("TF_ACC_STRESS_TESTS must be set to a truthy value for stress tests")
215+
}
216+
212217
stackID := getTestStackID(t)
213218
baseName := fmt.Sprintf("stress-test-%s", acctest.RandString(8))
214219

internal/resources/asserts/resource_disabled_alert_config_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ resource "grafana_asserts_suppressed_assertions_config" "test" {
185185
func TestAccAssertsDisabledAlertConfig_eventualConsistencyStress(t *testing.T) {
186186
testutils.CheckCloudInstanceTestsEnabled(t)
187187

188+
// Skip this flaky test unless explicitly enabled
189+
if !testutils.AccTestsEnabled("TF_ACC_STRESS_TESTS") {
190+
t.Skip("TF_ACC_STRESS_TESTS must be set to a truthy value for stress tests")
191+
}
192+
188193
stackID := getTestStackID(t)
189194
baseName := fmt.Sprintf("stress-disabled-%s", acctest.RandString(8))
190195

pkg/provider/configure_clients.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func getHTTPHeadersMap(providerConfig ProviderConfig) (map[string]string, error)
448448
}
449449

450450
func createAssertsClientIfConfigured(client *common.Client, providerConfig ProviderConfig) error {
451-
if !providerConfig.Auth.IsNull() {
451+
if !providerConfig.Auth.IsNull() && !providerConfig.URL.IsNull() {
452452
return createAssertsClient(client, providerConfig)
453453
}
454454
return nil

0 commit comments

Comments
 (0)