Skip to content
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

Application Insights Webtests #3331

Merged
merged 22 commits into from
May 18, 2019
Merged

Application Insights Webtests #3331

merged 22 commits into from
May 18, 2019

Conversation

AndyMoore
Copy link
Contributor

@AndyMoore AndyMoore commented Apr 29, 2019

fixes #1687

@ghost ghost added the size/XL label Apr 29, 2019
@AndyMoore
Copy link
Contributor Author

this should now pass. I'd appreciate some input as I think it's probably a bit light on tests

Also there was some debate as to how this should be configured - I've gone with straight xml which is what Microsoft go with, and will add this to the documentation, but this could be abstracted away as well..

@ghost ghost removed the waiting-response label Apr 29, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @AndyMoore, this is looking pretty good!

Aside from the comments i've left inline a couple things:

  • could we add a markdown file for documentation in the website folder?
  • could we add some more tests? the _basic one sould only be the required properties, the bare minimum required to provision the resource. a _complete one can also be added and then an _update that has multiple steps goes from basic -> complete -> basic to check properties update.

thanks!

azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
@katbyte
Copy link
Collaborator

katbyte commented May 10, 2019

A test is also failing with:

Test ended in panic.

------- Stdout: -------
=== RUN   TestAccAzureRMApplicationInsightsWebTests_basicWeb
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_basicWeb
=== CONT  TestAccAzureRMApplicationInsightsWebTests_basicWeb

------- Stderr: -------
panic: Invalid address to set: []string{"configuration"}

This means you are trying to set that on read and it is not part of the schema.

@AndyMoore
Copy link
Contributor Author

hi @katbyte thanks for the review. I've resolved the individual comments, and will add to the tests over the next few days

When I run the basicWeb test it passes locally:

?   	github.com/terraform-providers/terraform-provider-azurerm	[no test files]
=== RUN   TestAccAzureRMApplicationInsightsWebTests_basicWeb
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_basicWeb
=== CONT  TestAccAzureRMApplicationInsightsWebTests_basicWeb
--- PASS: TestAccAzureRMApplicationInsightsWebTests_basicWeb (158.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	158.886s

@ghost ghost removed the waiting-response label May 15, 2019
@AndyMoore
Copy link
Contributor Author

updated with tests as requested:

=== RUN   TestAccAzureRMApplicationInsightsWebTests_basic
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_basic
=== RUN   TestAccAzureRMApplicationInsightsWebTests_complete
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_complete
=== RUN   TestAccAzureRMApplicationInsightsWebTests_update
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_update
=== RUN   TestAccAzureRMApplicationInsightsWebTests_requiresImport
--- SKIP: TestAccAzureRMApplicationInsightsWebTests_requiresImport (0.00s)
    resource_arm_application_insights_webtests_test.go:109: Skipping since resources aren't required to be imported
=== CONT  TestAccAzureRMApplicationInsightsWebTests_basic
=== CONT  TestAccAzureRMApplicationInsightsWebTests_update
=== CONT  TestAccAzureRMApplicationInsightsWebTests_complete
--- PASS: TestAccAzureRMApplicationInsightsWebTests_basic (153.51s)
--- PASS: TestAccAzureRMApplicationInsightsWebTests_complete (246.36s)
--- PASS: TestAccAzureRMApplicationInsightsWebTests_update (292.42s)
PASS

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @AndyMoore

Thanks for pushing those updates - taking a look through this is looking pretty good - if we can fix up the remaining comments this should otherwise be good to merge 👍

Thanks!

azurerm/provider.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_insights_webtests_test.go Outdated Show resolved Hide resolved
@AndyMoore
Copy link
Contributor Author

=== RUN   TestAccAzureRMApplicationInsightsWebTests_basic
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_basic
=== RUN   TestAccAzureRMApplicationInsightsWebTests_complete
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_complete
=== RUN   TestAccAzureRMApplicationInsightsWebTests_update
=== PAUSE TestAccAzureRMApplicationInsightsWebTests_update
=== RUN   TestAccAzureRMApplicationInsightsWebTests_requiresImport
--- SKIP: TestAccAzureRMApplicationInsightsWebTests_requiresImport (0.00s)
    resource_arm_application_insights_webtests_test.go:105: Skipping since resources aren't required to be imported
=== CONT  TestAccAzureRMApplicationInsightsWebTests_basic
=== CONT  TestAccAzureRMApplicationInsightsWebTests_update
=== CONT  TestAccAzureRMApplicationInsightsWebTests_complete
--- PASS: TestAccAzureRMApplicationInsightsWebTests_basic (84.61s)
--- PASS: TestAccAzureRMApplicationInsightsWebTests_complete (85.89s)
--- PASS: TestAccAzureRMApplicationInsightsWebTests_update (207.05s)
PASS

tests still passing

will get the documents done asap

@ghost ghost removed the waiting-response label May 15, 2019
@ghost ghost added the documentation label May 16, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

@AndyMoore,

By default terraform ignores such schema errors. For our tests we turn on "strict" mode by running the tests with the following environment variable TF_SCHEMA_PANIC_ON_ERROR=1

I've left a comment on the offending line that is trying to set something that doesn't exist in the schema

azurerm/resource_arm_application_insights_webtests.go Outdated Show resolved Hide resolved
@AndyMoore
Copy link
Contributor Author

@katbyte removed

@ghost ghost removed the waiting-response label May 17, 2019
@katbyte katbyte added this to the v1.29.0 milestone May 18, 2019
@katbyte katbyte merged commit ae14bfa into hashicorp:master May 18, 2019
katbyte added a commit that referenced this pull request May 18, 2019
@katbyte
Copy link
Collaborator

katbyte commented May 18, 2019

Approved (forgot to click submit following):

Thanks for the updates @AndyMoore. Aside from renaming test_configurations to configurations this LGTM, hope you don't mind but I've pushed some changes to this affect 🙂

@AndyMoore
Copy link
Contributor Author

thanks @katbyte

@ghost
Copy link

ghost commented May 26, 2019

This has been released in version 1.29.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.29.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 18, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 18, 2019
@AndyMoore AndyMoore deleted the webtests branch June 28, 2019 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Insights Webtests - Url Ping Test
3 participants