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

feat(project): implement project import #96

Closed
wants to merge 2 commits into from

Conversation

Ameausoone
Copy link

Hello,

I implement project import, and I had acceptance test. It closes #51

But I couldn't make acceptance tests worked on my computer for project resource.

I try my code manually, it worked, but when I run test acceptance I got this :

`
=== RUN TestAccProject_importBasic
--- FAIL: TestAccProject_importBasic (2.23s)
testing.go:568: Step 0 error: After applying this step, the plan was not empty:

    DIFF:
    
    DESTROY/CREATE: mongodbatlas_project.test
      cluster_count: "0" => "<computed>"
      created:       "2019-06-29T20:09:36Z" => "<computed>"
      id:            "5d17c57fa6f239a99dd3c355" => "<computed>"
      name:          "test" => "test"
      org_id:        "5d17c57fa6f239a99dd3c356" => "" (forces new resource)
    
    
    
    STATE:
    
    mongodbatlas_project.test:
      ID = 5d17c57fa6f239a99dd3c355
      provider = provider.mongodbatlas
      cluster_count = 0
      created = 2019-06-29T20:09:36Z
      name = test
      org_id = 5d17c57fa6f239a99dd3c356
testing.go:629: Error destroying resource! WARNING: Dangling resources
    may exist. The full state and error is shown below.
    
    Error: Check failed: projects "5d17c57fa6f239a99dd3c355" still exists
    
    State: <no state>

FAIL
`

But when I run basic acceptance test, I got the same issue :

`
=== RUN TestAccMongodbatlasProject_basic
--- FAIL: TestAccMongodbatlasProject_basic (2.87s)
testing.go:568: Step 0 error: After applying this step, the plan was not empty:

    DIFF:
    
    DESTROY/CREATE: mongodbatlas_project.test
      cluster_count: "0" => "<computed>"
      created:       "2019-06-29T20:10:58Z" => "<computed>"
      id:            "5d17c5d2c56c981a2afdeeee" => "<computed>"
      name:          "testAcc" => "testAcc"
      org_id:        "5d17c5d2c56c981a2afdeeef" => "" (forces new resource)
    
    
    
    STATE:
    
    mongodbatlas_project.test:
      ID = 5d17c5d2c56c981a2afdeeee
      provider = provider.mongodbatlas
      cluster_count = 0
      created = 2019-06-29T20:10:58Z
      name = testAcc
      org_id = 5d17c5d2c56c981a2afdeeef

FAIL
`
I don't understand why(and how) terraform plan determine that "org_id" should be empty ?

@Ameausoone
Copy link
Author

OK I just found the issue, I will fix this in the PR.

@Ameausoone Ameausoone closed this Jul 4, 2019
@Ameausoone
Copy link
Author

Sorry, I'm discovering terraform, the acceptance test framework and golang, I see that project import works through "ImportStatePassthrough". So I close my PR ^^

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

Successfully merging this pull request may close these issues.

Allow importing projects
1 participant