Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix astra token integration test (#402)
The token integration test started failing after the addition of the optional `org_id` field (#399). The initial token creation works successfully but subsequent calls to Terraform apply cause the token to be regenerated instead of re-using the previously generated token. Adding the `Computed: true` flag fixes this issue by indicating to the Terraform SDK that the field was automatically generated from the auth token. Error message from tests: ``` === RUN TestToken 2024/09/19 21:00:31 [DEBUG] POST https://api.test.cloud.datastax.com/v2/organizations/roles 2024/09/19 21:00:31 [DEBUG] GET https://api.test.cloud.datastax.com/v2/currentOrg 2024/09/19 21:00:31 [DEBUG] GET https://api.test.cloud.datastax.com/v2/organizations/roles/6c081bb7-3dce-4525-8c19-2ae16e0b13e9 2024/09/19 21:00:31 [DEBUG] POST https://api.test.cloud.datastax.com/v2/tokens resource_token_test.go:11: Step 1/1 error: After applying this test step, the plan was not empty. stdout: Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: -/+ destroy and then create replacement Terraform will perform the following actions: # astra_token.example must be replaced -/+ resource "astra_token" "example" { ~ client_id = "kqOPeOShqbFZXMbpdzstdmKs" -> (known after apply) ~ id = "kqOPeOShqbFZXMbpdzstdmKs" -> (known after apply) - org_id = "3155c078-f822-4ae2-8605-f2f49e6d7ca1" -> null # forces replacement ~ secret = (sensitive value) ~ token = (sensitive value) # (1 unchanged attribute hidden) } Plan: 1 to add, 0 to change, 1 to destroy. --- FAIL: TestToken (2.89s) ```
- Loading branch information