cockroachdb / terraform-provider-cockroach

Terraform provider for CockroachDB Cloud
Apache License 2.0
56 stars 10 forks source link

Mock tests #42

Closed erademacher closed 1 year ago

erademacher commented 1 year ago

Split out the existing resource tests into acceptance tests and integration tests. They do the same thing, but the integration tests use gomock and don't take 45m and an extra AWS bill to run.

I configured the CI workflow to use integration tests, though we can talk about adding the acceptance tests back as a prerelease check. I'd need to read through some docs to figure out how to do that.

Bumped Go to 1.18 to make use of generics for HookGlobal.

erademacher commented 1 year ago

These tests are failing after dropping my other two in-review commits. I'm going to rebase again to fix it.

erademacher commented 1 year ago

Edit: All good :) Ready for review! Feel free to only pay attention to the newest commit since the others are covered in other PRs.

erademacher commented 1 year ago

TFTR!

However, we have to write acceptance tests which run periodically and on pre-release. These acceptance tests should also include the update of the resources where the most of the issues in TF provider gets introduced while changing the TF state. We can handle those in separate PR.

Totally agree. I'm going to add update tests next, and I'll look into running full acceptance tests nightly and during prerelease.