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

TF Acceptance Tests #165

Closed
dehume opened this issue May 25, 2023 · 4 comments · Fixed by #200 or #201
Closed

TF Acceptance Tests #165

dehume opened this issue May 25, 2023 · 4 comments · Fixed by #200 or #201
Labels
enhancement New feature or request

Comments

@dehume
Copy link
Contributor

dehume commented May 25, 2023

Currently the integration tests with the docker compose using the Materialize image only does apply -> plan -> destroy. It would be good to also tests applicable updates and have a flow of: apply -> plan -> update -> plan -> destroy.

@dehume dehume added the enhancement New feature or request label May 25, 2023
@dehume dehume changed the title Update Integration Tests TF Updates in Integration Tests May 25, 2023
@dehume
Copy link
Contributor Author

dehume commented May 26, 2023

https://terratest.gruntwork.io/

benesch added a commit that referenced this issue Jun 5, 2023
Gracefully handle the situation where a resource has gone missing
outside of Terraform (e.g., because the user manually ran a `DROP`
command).

This logic was applied to table resources as a one-off in #155, but that
code appears to have gotten lost in 9235b4b. This commit re-adds the
logic for all resource types.

No tests, because our current testing infrastructure is not powerful
enough to handle this. Will put up a test in a separate PR that enhances
the testing infrastructure (see #165).

Fix #157.
benesch added a commit that referenced this issue Jun 5, 2023
Terraform has a standard acceptance testing framework [0] that allows
for testing the complete lifecyle of provider resources: apply, plan,
refresh, destroy, etc. In particular, this makes it possible to test
things like a resource going missing due to a manual drop (#157).

This commit wires up the acceptance test framework, and then adds some
basic acceptance tests for creating secrets, creating cluster replicas,
and refreshing state for disappearing secrets.

Ultimately I think we should move all of today's integration tests to
this acceptance test framework.

Work towards #165.

[0]: https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests
benesch added a commit that referenced this issue Jun 5, 2023
Terraform has a standard acceptance testing framework [0] that allows
for testing the complete lifecyle of provider resources: apply, plan,
refresh, destroy, etc. In particular, this makes it possible to test
things like a resource going missing due to a manual drop (#157).

This commit wires up the acceptance test framework, and then adds some
basic acceptance tests for creating secrets, creating cluster replicas,
and refreshing state for disappearing secrets.

Ultimately I think we should move all of today's integration tests to
this acceptance test framework.

Work towards #165.

[0]: https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests
@benesch
Copy link
Member

benesch commented Jun 5, 2023

Noticed this this weekend while I was working on #176. Terraform has a builtin acceptance test framework that I think we should use! I put up #177 for review.

@dehume dehume changed the title TF Updates in Integration Tests TF AcceptanceTests Jun 8, 2023
@dehume dehume changed the title TF AcceptanceTests TF Acceptance Tests Jun 8, 2023
@dehume
Copy link
Contributor Author

dehume commented Jun 8, 2023

Remaining resources that will need acceptance tests after #177 is merged.

Resource Create Delete Update Assigned Notes
Cluster X X Done Implemented with #177
Cluster Replica X X X @dehume Implemented with #177
Connection AWS Privatelink X X X @dehume
Connection Confluence Schema X X X @dehume
Connection Kafka X X X @dehume
Connection Postgres X X X @dehume
Connection SSH Tunnel X X X @dehume
Database X X @dehume
Index X X @dehume
Materialized View X X X @bobbyiliev Implemented with #198
Schema X X @bobbyiliev
Secret X X X Done Implemented with #177
Sink Kafka X X X @bobbyiliev
Source Kafka X X X @bobbyiliev
Source Load Generator X X X @bobbyiliev
Source Postgres X X X @bobbyiliev
Table X X X @bobbyiliev
Type X X @bobbyiliev
View X X X @bobbyiliev

dehume pushed a commit that referenced this issue Jun 12, 2023
* Add acceptance tests

Terraform has a standard acceptance testing framework [0] that allows
for testing the complete lifecyle of provider resources: apply, plan,
refresh, destroy, etc. In particular, this makes it possible to test
things like a resource going missing due to a manual drop (#157).

This commit wires up the acceptance test framework, and then adds some
basic acceptance tests for creating secrets, creating cluster replicas,
and refreshing state for disappearing secrets.

Ultimately I think we should move all of today's integration tests to
this acceptance test framework.

Work towards #165.
@dehume
Copy link
Contributor Author

dehume commented Jun 13, 2023

Will be covered in two PRs:

This was linked to pull requests Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants