Open mitchnielsen opened 3 weeks ago
something to think about - not sure if we can do this with golang tests, but in pytest you can create test groups and invoke them separately. i really do like this local testing facility, but if it only supports non-Cloud-specific features/resource, maybe we should group our tests to be OSS vs. Cloud and run them with separate make commands. Cloud would be the full thing, but OSS would be a subset - the benefit would be that we're testing provider compatibility with OSS, but also shorter feedback loop. and then the Cloud tests can run in CI/CD
Yeah good points, we'll have to delineate which ones are Cloud-only for sure.
I do think the OSS tests could run in CI/CD too if we wanted, since all we need is that prefecthq/prefect
image running.
As for grouping them in Golang, I think there's usually a few options:
go test -tags=<tag>
go test -run CommonPrefix ...
tags sound like the way to go 🙌
After some discussion, it may be more valuable to prioritize https://github.com/PrefectHQ/terraform-provider-prefect/issues/218 for now as that would increase the reliability of tests in Prefect Cloud (which can run all tests, rather than just a subset that could run when testing against OSS).
Summary
In https://github.com/PrefectHQ/terraform-provider-prefect/issues/186, we added support for running Prefect in Docker Compose and being able to test
terraform plan/apply
commands against it.This is helpful for local development and testing, but we may also be able to use this in CI.
We could replace the PREFECT_API_URL value in the CI file to point to something like
http://localhost:4200
, and tell CI to spin up Prefect using the Docker Compose configuration.This means we'd be testing in an ephemeral instance of Prefect instead of against dev/staging environments, which can cause transient errors due to environment pollution.
One caveat mentioned by @parkedwards:
Acceptance criteria