helper/logging: Adjust unit test regex flag #1224
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally found in #1223 - The unit test
TestNewLoggingHTTPTransport_LogMasking
started failing in a recent dependabot PR: https://github.com/hashicorp/terraform-plugin-sdk/actions/runs/5473296958/jobs/10006381743?pr=1223The test failing is using a
GET https://www.terraform.io
request to test the masking for the logger on the response body, using a regex<html>.*</html>
for the mask. I believe the site must have changed recently and introduced some\n
characters, because.
in RE2 regex does not match\n
characters by default: https://github.com/google/re2/blob/a57a1d6462a1613e5e2cfd6fb1ce26d36706a9af/doc/syntax.txt#L68Adjusting the test's regex to include that flag should fix it ->
(?s)<html>.*</html>
Notes