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

New data source: azurerm_cognitive_account #8773

Merged
merged 16 commits into from
Oct 29, 2020

Conversation

Lucretius
Copy link
Contributor

Resolves #7765

Note that I do not use this resource and as such have not tested this functionality manually. Instead I am relying on the test coverage, and using the existing resource code, modified for the data source. If anyone uses this resource and sees anything missing in the data source that they expect to retrieve, let me know.

@ghost ghost added size/XL and removed size/L labels Oct 7, 2020
@ghost ghost added size/L and removed size/XL labels Oct 7, 2020
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.

Hey @Lucretius - thanks for this pr! overall looks great but there is a failing test due to an invalid tf config.

Once thats fixed up this should be good to go!

@katbyte katbyte added this to the v2.34.0 milestone Oct 22, 2020
Co-authored-by: kt <kt@katbyte.me>
@Lucretius
Copy link
Contributor Author

Hi @katbyte thanks for the PR review. I wanted to ask about the failing test, particularly how I can tell I've got a failing test. I know on this and another PR I've got open the latest builds that have run both seem to have a passing checkmarks in TravisCI for the make test stage (and every other stage) - which is what seems to be running the acceptance test suite. This makes me think that the tests have all passed, but apparently this is not the case.

I am wondering if there is somewhere else I should be seeing these test failures? I don't have an Azure account that I am using to run acceptance tests against, so I am depending on the CI tooling to do so. If there is a place I can see these failing tests, I will make sure to look there to save you and the team some time :)

@ghost ghost removed the waiting-response label Oct 22, 2020
@katbyte
Copy link
Collaborator

katbyte commented Oct 23, 2020

ahh @Lucretius - you will need an azure account to run things against and setup a service principal. The CI tooling doesn't run any acceptance tests and we don't expose our CI system for them to the public as it costs money to run most tests. Once you have that setup you can run them by make testacc TEST=./azurerm/internal/services/cognitive/tests TESTARGS="-parallel 11 -test.run=TestAccAzureRMPrefixHere"

@Lucretius
Copy link
Contributor Author

Oh, that would explain why I keep missing tests. I've got a personal Azure account, I will have to go and see about setting it up for these tests then. Thank you for explaining that to me!

@katbyte
Copy link
Collaborator

katbyte commented Oct 23, 2020

no bother 🙂 I have a .sh file thati source to set my env vars for it:

       │ File: /Users/kt/hashi/sync/set.az.rm.sh
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ #!/bin/bash
   2   │
   3   │ export ARM_TENANT_ID=1234567
   4   │ export ARM_SUBSCRIPTION_ID=1234567
   5   │ export ARM_CLIENT_ID=1234567
   6   │ export ARM_CLIENT_SECRET=""
   7   │ export ARM_ENVIRONMENT=public
   8   │ export ARM_TEST_LOCATION=westeurope
   9   │ export ARM_TEST_LOCATION_ALT=eastus2
  10   │ export ARM_TEST_LOCATION_ALT2=westus

which makes it easy to setup for tests in a new shell window

@Lucretius
Copy link
Contributor Author

I ran the failing tests locally and got things working. It looks like tflint is now run via Github Actions and a bunch of stuff breaks on that step, but should be unrelated to my changes.

@jackofallops
Copy link
Member

Hi @Lucretius - there's noise in the linter that will be be resolved by a recent release of the linter, there's a genuine error message in there:

==> Checking acceptance test terraform blocks are formatted...
./azurerm/internal/services/cognitive/tests/cognitive_account_data_source_test.go:35

@jackofallops jackofallops modified the milestones: v2.34.0, v2.35.0 Oct 29, 2020
Lucretius and others added 3 commits October 29, 2020 09:13
Signed-off-by: Robert Lippens <robertl@sirrus7.com>
…ius/terraform-provider-azurerm into data-source-arm-cognitive-account
@jackofallops jackofallops modified the milestones: v2.35.0, v2.34.0 Oct 29, 2020
@katbyte katbyte merged commit a984d80 into hashicorp:master Oct 29, 2020
katbyte added a commit that referenced this pull request Oct 29, 2020
@Lucretius Lucretius deleted the data-source-arm-cognitive-account branch October 29, 2020 17:01
@Lucretius
Copy link
Contributor Author

Thanks for hanging with me on that, I think my editor must be auto-formatting the blocks - all I had done was delete a line, did not expect it to cause the linter to fail.

@ghost
Copy link

ghost commented Oct 29, 2020

This has been released in version 2.34.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 = "~> 2.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 29, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 29, 2020
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.

Support for azurerm_cognitive_account Data Source
4 participants