Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix monitor schema in framework implementation #256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tosuke
Copy link
Contributor

@tosuke tosuke commented Feb 20, 2025

In SDK implementation, mackerel_monitor.anomaly_detection.scopes is required:

"scopes": {
Type: schema.TypeSet,
Required: true,
Elem: &schema.Schema{Type: schema.TypeString},
},

But in framework implementation, it is a optional attribute. This PR makes it required.

Output from acceptance testing:

$ make testacc TESTS='AccMackerelMonitor'
TF_ACC=1 go test -v ./... -run AccMackerelMonitor -timeout 120m
?       github.com/mackerelio-labs/terraform-provider-mackerel  [no test files]
testing: warning: no tests to run
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/internal/mackerel        0.277s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/internal/planmodifierutil        0.426s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/internal/provider        0.795s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/internal/typeutil        0.454s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/internal/validatorutil   0.282s [no tests to run]
=== RUN   TestAccMackerelMonitor_HostMetric
=== PAUSE TestAccMackerelMonitor_HostMetric
=== RUN   TestAccMackerelMonitor_Connectivity
=== PAUSE TestAccMackerelMonitor_Connectivity
=== RUN   TestAccMackerelMonitor_ServiceMetric
=== PAUSE TestAccMackerelMonitor_ServiceMetric
=== RUN   TestAccMackerelMonitor_External
=== PAUSE TestAccMackerelMonitor_External
=== RUN   TestAccMackerelMonitor_Expression
=== PAUSE TestAccMackerelMonitor_Expression
=== RUN   TestAccMackerelMonitor_AnomalyDetection
=== PAUSE TestAccMackerelMonitor_AnomalyDetection
=== RUN   TestAccMackerelMonitor_Query
=== PAUSE TestAccMackerelMonitor_Query
=== CONT  TestAccMackerelMonitor_HostMetric
=== CONT  TestAccMackerelMonitor_Expression
=== CONT  TestAccMackerelMonitor_Query
=== CONT  TestAccMackerelMonitor_ServiceMetric
=== CONT  TestAccMackerelMonitor_Connectivity
=== CONT  TestAccMackerelMonitor_External
=== CONT  TestAccMackerelMonitor_AnomalyDetection
--- PASS: TestAccMackerelMonitor_Expression (5.87s)
--- PASS: TestAccMackerelMonitor_ServiceMetric (6.21s)
--- PASS: TestAccMackerelMonitor_HostMetric (6.50s)
--- PASS: TestAccMackerelMonitor_Connectivity (6.51s)
--- PASS: TestAccMackerelMonitor_Query (6.54s)
--- PASS: TestAccMackerelMonitor_AnomalyDetection (6.55s)
--- PASS: TestAccMackerelMonitor_External (6.61s)
PASS
ok      github.com/mackerelio-labs/terraform-provider-mackerel/mackerel 7.746s
...

Copy link
Member

@ne-sachirou ne-sachirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♀️

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants