Skip to content

Commit a9ab3f1

Browse files
authored
chore: Generate alert configuration resource and add acc tests (#3880)
1 parent 1e0b5b5 commit a9ab3f1

File tree

9 files changed

+1891
-4
lines changed

9 files changed

+1891
-4
lines changed

.github/workflows/acceptance-tests-runner.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ jobs:
299299
- 'internal/provider/*.go'
300300
autogen_fast:
301301
- 'internal/common/autogen/*.go'
302+
- 'internal/serviceapi/alertconfigurationapi/*.go'
302303
- 'internal/serviceapi/auditingapi/*.go'
303304
- 'internal/serviceapi/customdbroleapi/*.go'
304305
- 'internal/serviceapi/databaseuserapi/*.go'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ tools: ## Install the dev tools (dependencies)
111111
go install github.com/icholy/gomajor@latest
112112
go install github.com/terraform-linters/tflint@v0.52.0
113113
go install github.com/rhysd/actionlint/cmd/actionlint@latest
114-
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest
114+
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@v0.38.0 # Pinning version since v0.39.0 fails to fix files with large structs. See versions at https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/fieldalignment?tab=versions
115115
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest
116116
go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
117117
go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest

internal/service/alertconfiguration/resource_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestAccConfigRSAlertConfiguration_basic(t *testing.T) {
7474
ImportStateIdFunc: importStateProjectIDFunc(resourceName),
7575
ImportState: true,
7676
ImportStateVerify: true,
77-
ImportStateVerifyIgnore: []string{"project_id", "updated"},
77+
ImportStateVerifyIgnore: []string{"updated"},
7878
},
7979
},
8080
})
@@ -147,7 +147,7 @@ func TestAccConfigRSAlertConfiguration_withNotifications(t *testing.T) {
147147
ImportStateIdFunc: importStateProjectIDFunc(resourceName),
148148
ImportState: true,
149149
ImportStateVerify: true,
150-
ImportStateVerifyIgnore: []string{"project_id", "updated"},
150+
ImportStateVerifyIgnore: []string{"updated"},
151151
},
152152
},
153153
})
@@ -263,7 +263,7 @@ func TestAccConfigRSAlertConfiguration_withThreshold(t *testing.T) {
263263
ImportStateIdFunc: importStateProjectIDFunc(resourceName),
264264
ImportState: true,
265265
ImportStateVerify: true,
266-
ImportStateVerifyIgnore: []string{"project_id", "updated", "matcher.0.field_name"},
266+
ImportStateVerifyIgnore: []string{"updated", "matcher.0.field_name"},
267267
},
268268
},
269269
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package alertconfigurationapi_test
2+
3+
import (
4+
"os"
5+
"testing"
6+
7+
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc"
8+
)
9+
10+
func TestMain(m *testing.M) {
11+
cleanup := acc.SetupSharedResources()
12+
exitCode := m.Run()
13+
cleanup()
14+
os.Exit(exitCode)
15+
}

internal/serviceapi/alertconfigurationapi/resource.go

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)