-
Notifications
You must be signed in to change notification settings - Fork 18k
log/slog: faulty test fails on spaces in file path #61161
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
(attn @jba) Marking as release-blocker for Go 1.21 because this is a new test failure in 1.21 and |
@merrickclay, please feel free to send a fix per https://go.dev/doc/contribute. (I would recommend sending directly through Gerrit instead of using a GitHub PR — the GitHub import flow is kind of rough and you're going to end up in Gerrit anyway.) |
@merrickclay, let me know if you want to fix. If not, I'm happy to do it. |
@jba I'm walking through https://go.dev/doc/contribute to submit a fix :) |
Change https://go.dev/cl/508055 mentions this issue: |
Adds an optional close quote in the expected log message regex for TestConnections to prevent failing when the source filepath is surrounded in quotes due to it containing one or more spaces. Fixes golang#61161 Change-Id: I0dd71fb4389bff963bbfdc668ef4e4dfe787eafc Reviewed-on: https://go-review.googlesource.com/c/go/+/508055 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Adds an optional close quote in the expected log message regex for TestConnections to prevent failing when the source filepath is surrounded in quotes due to it containing one or more spaces. Fixes golang#61161 Change-Id: I0dd71fb4389bff963bbfdc668ef4e4dfe787eafc Reviewed-on: https://go-review.googlesource.com/c/go/+/508055 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Adds an optional close quote in the expected log message regex for TestConnections to prevent failing when the source filepath is surrounded in quotes due to it containing one or more spaces. Fixes golang#61161 Change-Id: I0dd71fb4389bff963bbfdc668ef4e4dfe787eafc Reviewed-on: https://go-review.googlesource.com/c/go/+/508055 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
What version of Go are you using (
go version
)?Compiler
go version go1.20.5 windows/amd64
Attempted to Build
go version devel go1.21-5b72f45dd1 Fri Jun 30 22:02:00 2023 +0000 windows/amd64
Does this issue reproduce with the latest release?
slog is in next release
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
cd src
all.bat
What did you expect to see?
I expected all tests to pass
What did you see instead?
TestConnections failed
It appears the 'expected' regex does not anticipate the quotes that are added to the source when the path has a space in it (as it does in the
Merrick Clay
directory). Either the regex should be updated to add an optional quote afterlogger_test.go:\d{3
or slog should be updated to always or never surround the source in quotes (and the regex should be updated).Updating the regex in the test by adding
"?
afterlogger_test.go:\d{3
allowed me to build and pass all tests. I'd love to put resolve this issue with a PR as my first contribution to the project once a path forward is agreed upon :)The text was updated successfully, but these errors were encountered: