Skip to content
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

Emit failure reasons in debug logs #956

Closed
rileykarson opened this issue May 4, 2022 · 4 comments · Fixed by #958
Closed

Emit failure reasons in debug logs #956

rileykarson opened this issue May 4, 2022 · 4 comments · Fixed by #958
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rileykarson
Copy link
Contributor

SDK version

	github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1

Use-cases

This will make it easier to view debug logs, as they'll contain additional context on the failure reason without needing to check the test runner's summary view for the direct failure.

This would hopefully include test checks as well as failures at the config stage like unexpected diffs.

Attempted Solutions

N/A

Proposal

As part of the test framework, capture and emit test failure reasons in the debug log. See an example like https://gist.github.com/rileykarson/7c9494a513b94118cfddc73a3b79fb8a, where "fail" and "error" don't appear in the debug logs (for a relevant reason) but do in the summary view. This led to a contributor not too familiar with debug logs looking into one of the unrelated failure messages as they weren't aware they should check the summary view in the build log.

References

@rileykarson rileykarson added the enhancement New feature or request label May 4, 2022
@bflad bflad added this to the v2.16.0 milestone May 4, 2022
@bflad bflad self-assigned this May 4, 2022
bflad added a commit that referenced this issue May 4, 2022
Reference: #956

If provider developers are using `TF_ACC_LOG_PATH` or `TF_LOG_PATH_MASK`, this will ensure that the separate log file will  include the test failure reason, in addition to the test output.
@bflad
Copy link
Member

bflad commented May 4, 2022

Hey @rileykarson 👋 Thanks for raising this. I've submitted #958, which I believe should cover this ask. Can you please double check that is what you are looking for?

@rileykarson
Copy link
Contributor Author

Looks right to me!

@bflad bflad closed this as completed in #958 May 5, 2022
bflad added a commit that referenced this issue May 5, 2022
Reference: #956

If provider developers are using `TF_ACC_LOG_PATH` or `TF_LOG_PATH_MASK`, this will ensure that the separate log file will  include the test failure reason, in addition to the test output.
@bflad
Copy link
Member

bflad commented May 5, 2022

Thanks for confirming! I've pulled this in, but considering we just cut a release yesterday, I'm going to see if there are additional things that come in before cutting another.

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants