-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Run the redis test server with enable-debug-command #654
Conversation
This is required for Redis >= 7.x, cf. https://raw.githubusercontent.com/redis/redis/7.0/00-RELEASENOTES: * MODULE and DEBUG commands disabled (protected) by default, for better security (#9920) Without this patch, some unit tests fail: ``` === RUN TestLatency reply_test.go:256: Error Trace: /<<PKGBUILDDIR>>/_build/src/github.com/gomodule/redigo/redis/reply_test.go:256 Error: Received unexpected error: ERR DEBUG command not allowed. If the enable-debug-command option is set to "local", you can run it from a local connection, otherwise you need to set this option in the configuration file, and then restart the server. Test: TestLatency --- FAIL: TestLatency (0.00s) === RUN TestLatencyHistories reply_test.go:304: Error Trace: /<<PKGBUILDDIR>>/_build/src/github.com/gomodule/redigo/redis/reply_test.go:304 Error: Received unexpected error: ERR DEBUG command not allowed. If the enable-debug-command option is set to "local", you can run it from a local connection, otherwise you need to set this option in the configuration file, and then restart the server. Test: TestLatencyHistories --- FAIL: TestLatencyHistories (0.00s) ```
116465c
to
3d8403e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR, appreciated.
As you said your new to go, I've taken the opportunity to share some improvements to this, hope that helps.
As this not needed outside the package there's no need to export it so lower case the type name. Also switching to semantic version naming of the parameters. Co-authored-by: Steven Hartland <[email protected]>
This can be improve to the following, notice a few things: - It's idiomatic in go to avoid naming things get / set - Wrap errors with fmt.Errorf to provide context to the user Co-authored-by: Steven Hartland <[email protected]>
Co-authored-by: Steven Hartland <[email protected]>
Thanks for the review and advice! I applied your suggestions, then fixed the details to get it to build. I think it's good now. |
Sorry @elboulangero missed the notification for this, merged. |
@stevenh no worries! |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/gomodule/redigo](https://togithub.com/gomodule/redigo) | `v1.8.9` -> `v1.9.2` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>gomodule/redigo (github.com/gomodule/redigo)</summary> ### [`v1.9.2`](https://togithub.com/gomodule/redigo/releases/tag/v1.9.2) [Compare Source](https://togithub.com/gomodule/redigo/compare/v1.9.1...v1.9.2) <a name='v1.9.2'></a> ##### v1.9.2 Release Notes (2024-02-25T12:54:41Z) #### Changelog ##### Bug fixes - [`e05a63b`](https://togithub.com/gomodule/redigo/commit/e05a63bfd93c1db480ee706c1686d9dd2385016b): fix: bump go version to 1.17 ([#​666](https://togithub.com/gomodule/redigo/issues/666)) ([@​stevenh](https://togithub.com/stevenh)) ##### Continuous Integration - [`4c535aa`](https://togithub.com/gomodule/redigo/commit/4c535aa56d60a1dddd457a8e63caa463bcb5a70b): ci: fix go caching ([#​667](https://togithub.com/gomodule/redigo/issues/667)) ([@​stevenh](https://togithub.com/stevenh)) [Full Changelog](https://togithub.com/gomodule/redigo/compare/v1.9.1...v1.9.2) ### [`v1.9.1`](https://togithub.com/gomodule/redigo/releases/tag/v1.9.1) [Compare Source](https://togithub.com/gomodule/redigo/compare/v1.9.0...v1.9.1) <a name='v1.9.1'></a> ##### v1.9.1 Release Notes (2024-02-20T23:51:27Z) #### Changelog ##### Chores - [`162ed02`](https://togithub.com/gomodule/redigo/commit/162ed022a35991830c265f24896b07d6537b3702): chore: retract v1.8.10 ([#​664](https://togithub.com/gomodule/redigo/issues/664)) ([@​stevenh](https://togithub.com/stevenh)) ##### Continuous Integration - [`cfabb1f`](https://togithub.com/gomodule/redigo/commit/cfabb1f017433cdf852a4841a8c0125c48275c0b): ci: remove deprecated goreleaser option ([#​663](https://togithub.com/gomodule/redigo/issues/663)) ([@​stevenh](https://togithub.com/stevenh)) [Full Changelog](https://togithub.com/gomodule/redigo/compare/v1.9.0...v1.9.1) ### [`v1.9.0`](https://togithub.com/gomodule/redigo/releases/tag/v1.9.0) <a name='v1.9.0'></a> ##### v1.9.0 Release Notes (2024-02-20T21:32:43Z) #### Changelog ##### Features - [`1d393b3`](https://togithub.com/gomodule/redigo/commit/1d393b301b27d4934d4b76ff4df60859e296cdec): feat: add TestOnBorrowContext ([#​660](https://togithub.com/gomodule/redigo/issues/660)) ([@​vasayxtx](https://togithub.com/vasayxtx)) ##### Bug fixes - [`78e255f`](https://togithub.com/gomodule/redigo/commit/78e255f9bd2ae9c9885793a751f42f5698a5da8c): fix: test goroutine leaks ([#​643](https://togithub.com/gomodule/redigo/issues/643)) ([@​stevenh](https://togithub.com/stevenh)) ##### Chores - [`9f0d2e9`](https://togithub.com/gomodule/redigo/commit/9f0d2e92e55d22b4c6d05bf8528ae90ed7fea855): chore: remove debug check ([#​659](https://togithub.com/gomodule/redigo/issues/659)) ([@​stevenh](https://togithub.com/stevenh)) - [`8b1c13e`](https://togithub.com/gomodule/redigo/commit/8b1c13e0376bc43a2443a0b312567718b4afbcd9): chore: run test server with enable-debug-command ([#​654](https://togithub.com/gomodule/redigo/issues/654)) ([@​elboulangero](https://togithub.com/elboulangero)) - [`a60882b`](https://togithub.com/gomodule/redigo/commit/a60882bf9e77d7f428bdfa7e27516979d833f663): chore: update testify ([#​653](https://togithub.com/gomodule/redigo/issues/653)) ([@​stevenh](https://togithub.com/stevenh)) - [`9129745`](https://togithub.com/gomodule/redigo/commit/91297458446615564ead7370d273480ccd2120f3): chore: update github actions and fix tests ([#​657](https://togithub.com/gomodule/redigo/issues/657)) ([@​stevenh](https://togithub.com/stevenh)) ##### Continuous Integration - [`1bfd3c1`](https://togithub.com/gomodule/redigo/commit/1bfd3c16b111e999b1ba506ad0613c8322a97848): ci: add goreleaser, update action and go versions ([#​662](https://togithub.com/gomodule/redigo/issues/662)) ([@​stevenh](https://togithub.com/stevenh)) #### New Contributors - [@​elboulangero](https://togithub.com/elboulangero) made their first contribution in [https://github.com/gomodule/redigo/pull/654](https://togithub.com/gomodule/redigo/pull/654) - [@​vasayxtx](https://togithub.com/vasayxtx) made their first contribution in [https://github.com/gomodule/redigo/pull/660](https://togithub.com/gomodule/redigo/pull/660) [Full Changelog](https://togithub.com/gomodule/redigo/compare/v1.8.9...v1.9.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ffddorf/terraform-backend). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This is required for Redis >= 7.x, cf. https://raw.githubusercontent.com/redis/redis/7.0/00-RELEASENOTES:
Without this patch, some unit tests fail:
I tried to cook a clean patch but I'm not very familiar with Go, so it's not perfect.