-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How to use go's TestMain with terratest? #1047
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
Comments
Unfortunately this is currently not a supported mode of operation in terratest, primarily because we rely on the We are a bit buried to take this on, so I suspect this won't get implemented in the short term, unless someone from the community is willing to take it. |
@yorinasub17 I have been using below snippet (slightly modified from what I have originally pasted above) and it runs flawlessly so far:
I was also looking at beforeEach approach to create VPCs, but this does not scale well in my use case since VPC creation with all dependencies takes approx 5-8 minutes. |
If you have a working solution, then that's great! Does that solve your original problem of apply hanging when there is an error?
Ah, FWIW, the main way the Gruntwork team addresses this is by using subtests. It's not ideal due to the various gotchas around
|
I have very similar problem described here.
My use case is I'd like to pre-create few resources (VPC, Route53 zone) so other tests can use these.
So far I have managed to do this:
Altho if
terraform apply
in above snippet fails, looks like test is waiting for timeout actually to happen. Suspect it happens due to "custom" testing.T object.The text was updated successfully, but these errors were encountered: