Let’s say I have a module that I’m testing that uses a mocked provider. Is there a way to test the module’s outputs?
Obviously, some of the attributes within the fake provider will be fake / generated. But let’s say a simple example:
in main.tf
resource "google_secret_manager_secret" "this" {
secret_id = var.secret_id
replication {
auto {}
}
}
in outputs.tf
# Granted, in this case, we know what we're going to get, but a test could get
# more interesting if we did some mangling of the value that we wanted to
# test the logic of.
output "secret_id" {
description = "Secret ID for created secret."
value = google_secret_manager_secret.this.secret_id
}
I couldn’t find much in terms of any docs on a way, either with the mocked provider, or with a plan-only test (even though in a simplistic scenario like this where the attribute value is known, the plan will print the output). Is there an assertion that will already handle this scenario?