-
Notifications
You must be signed in to change notification settings - Fork 1
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
Terraform vs. Rspec logger isolation #46
Comments
Hi @plukevdh, We're glad you found it as we haven't even finished documenting / officially released it yet! I hope you are finding it useful and would be very open to further feedback in terms of how to improve. I'm not sure whether you are already aware but all the InfraBlocks terraform modules are already using In terms of your specific issue, the logging/output configuration probably needs some more work as it's a bit over complex. However, as it stands, there are 3 different outputs at play:
Right now,
As emboldened above, I believe the problem you are facing is that because you are overwriting RSpec.configure do |config|
config.terraform_logger = Logger::LogDevice.new($stdout)
config.terraform_stdout = Logger::LogDevice.new(IO::NULL)
end I do like the idea of separating the IO devices used for Let me know how you get on and as I say, feedback very welcome, |
@tobyclemson Great feedback. I'd not associated the split-ability in the logger functionality with the With that said, it might be helpful to delineate which of the output options is associated with what component. In the end, I think it would be clearer to make the options configurable based on behavior (do I want It is still 💯 worth it to have that stuff configurable in the Definitely take this all as constructive feedback from a very thankful developer. This library is solving a definite pain point and it's super validating to see someone else solving the same pains the way we would. |
Hi there! Thanks for this project. We found your RubyTerraform project and used it to write an rspec-terraform plugin... until we realized you all had done the same thing (and better).
Some usage feedback: One of the things it'd be nice to do is have the option to silence the
terraform plan
output. To do so, I can doHowever this appears to have the unintended side-effect of also silencing the
rspec-terraform
plugin's logging output. I assume this is because the logger gets reused between the RubyTerraform and RSpec::Terraform. It seems like it might be worthwhile to isolate the loggers so that we can toggle them/redirect them independently of one another.Perhaps alternatively (or in addition to), it might be nice to have an rspec option flag called
silence_terraform_output
that would redirect the terraform output toIO::NULL
.I'm happy to submit a PR implementing either/both of these options if you all think this would be valuable. Thoughts?
The text was updated successfully, but these errors were encountered: