-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing default_mode of WAF Rule through cloudflare_waf_rules data source #980
Conversation
seems reasonable 👍 can you please add test coverage for this new attribute? |
@jacobbednarz Of course, I can add some tests for this.
|
There is a section in the README on developing the provider which will step you through testing. Yes, you'll need a Cloudflare account as the tests create real resources.
https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/cloudflare/data_source_waf_rules_test.go#L13 is an example of an existing |
Config: testAccCloudflareWAFRulesConfig(zoneID, map[string]string{}, rnd), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckCloudflareWAFRulesDataSourceID(name), | ||
resource.TestCheckResourceAttrSet(name, "rules.#"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm afraid this assertion doesn't do assert anything useful for us here. this test is identical to some others and doesn't actually cover the functionality you've added.
perhaps have a look at testAccCheckCloudflareWAFRulesDataSourceID
and i suspect you'll need to programmatically loop through the resource rules and confirm the key is present in the state following this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to adjust the test case for this because as it stands, it is a duplicate of an existing test with a different name and doesn't cover the added fields being stored in state.
closing in favour of #1079 |
#979