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

v1: fixing import testing #702

Merged
merged 5 commits into from
Feb 22, 2021
Merged

Conversation

tombuildsstuff
Copy link
Contributor

This PR fixes an issue when running import tests using Binary Testing in v1 - when running an import test at this point we get the error:

=== CONT  TestAccResourceGroup_basic
    testing_new_import_state.go:140: Failed to find schema for resource with ID ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestRG-210210191428921623
        % = 5
        location = westeurope
        name = acctestRG-210210191428921623
        tags.% = 0
        timeouts.% = 4
        Tainted = false

Tracking this down, this is due to trying to parse provider.registry.terraform.io/hashicorp/blah.blah_resource - which results in a failure, which isn't propagated here:

Screenshot 2021-02-11 at 10 52 02

As such this PR fixes this string to be provider.blah.blah_resource rather than provider.registry.terraform.io/hashicorp/blah.blah_resource - meaning this parses correctly - and the import tests succeed.

@tombuildsstuff
Copy link
Contributor Author

With this change, this parses correctly:

Screenshot 2021-02-11 at 10 57 20

And the test passes:

2021/02/11 10:54:57 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccResourceGroup_basic
=== PAUSE TestAccResourceGroup_basic
=== CONT  TestAccResourceGroup_basic
--- PASS: TestAccResourceGroup_basic (226.29s)
PASS

You could argue that we should raise this error, which I'd agree with - but there's a number of these so perhaps that wants tackling in a separate sweep?

Copy over the addrs functions we need, and update terraform-plugin-test
to be more resilient of later go-plugin changes.
@ghost
Copy link

ghost commented Mar 25, 2021

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants