-
Notifications
You must be signed in to change notification settings - Fork 159
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
Running terratest #34
Comments
Terratest is typically used to run infrastructure tests, which can take a while—5, 10, or 30 minutes is normal, and tests that take over an hour are possible too. Also, those tests typically require authentication (e.g., authenticating too AWS) and have lots of side effects (e.g., creating resources in AWS), so if you interrupt them part way through (e.g., via Do you really want a pre-commit hook that takes that long, has lots of environmental requirements, and can't be interrupted? Seems like that would severely discourage committing early and often... |
That's true... if they need to run ~5+ minutes. But if we've tried to keep our "unit" tests slim, then they may not need to run 5 minutes or more on commit. The use-case that got me to ask was for a string manipulation module, which can run real unit tests, in the sense of classic software. That takes a few seconds, most of which goes to compiling Go. Microsoft blogged about a cute idea where they talk about limiting "unit" tests to tests which use But the question is excellent, and in lieu of making it easy on devs to shoot themselves in the foot, maybe there can be a FAQ entry on this with a solution of creating a local hook as I did, and with a big fat caveat emptor against why folks might want to think twice about it. For me this was initially annoying, as I use Go sparingly enough that navigating through installing Go, remembering how to use it (modules, packages, etc) and which tools to use took me a few hours that could have been spent just as easily on writing better tests (or better Terraform!) :) |
Hey,
Wondering if there's a reason why this repo doesn't supply a hook for running tests written with terratest (perhaps by default expecting to run
go test
from an expectedtest/
subdirectory)?Sorta like:
Thanks!
The text was updated successfully, but these errors were encountered: