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

Run the redis test server with enable-debug-command #654

Merged
merged 6 commits into from Feb 3, 2024

Conversation

elboulangero
Copy link
Contributor

@elboulangero elboulangero commented Oct 10, 2023

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)

I tried to cook a clean patch but I'm not very familiar with Go, so it's not perfect.

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)
```
Copy link
Collaborator

@stevenh stevenh left a 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.

redis/test_test.go Outdated Show resolved Hide resolved
redis/test_test.go Outdated Show resolved Hide resolved
redis/test_test.go Outdated Show resolved Hide resolved
elboulangero and others added 5 commits October 23, 2023 09:50
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 <stevenmhartland@gmail.com>
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 <stevenmhartland@gmail.com>
Co-authored-by: Steven Hartland <stevenmhartland@gmail.com>
@elboulangero
Copy link
Contributor Author

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.

@stevenh stevenh merged commit 8b1c13e into gomodule:master Feb 3, 2024
@stevenh
Copy link
Collaborator

stevenh commented Feb 3, 2024

Sorry @elboulangero missed the notification for this, merged.

@elboulangero
Copy link
Contributor Author

@stevenh no worries!

mraerino pushed a commit to ffddorf/terraform-backend that referenced this pull request Apr 28, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](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` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgomodule%2fredigo/v1.9.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgomodule%2fredigo/v1.9.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgomodule%2fredigo/v1.8.9/v1.9.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgomodule%2fredigo/v1.8.9/v1.9.2?slim=true)](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
([#&#8203;666](https://togithub.com/gomodule/redigo/issues/666))
([@&#8203;stevenh](https://togithub.com/stevenh))

##### Continuous Integration

-
[`4c535aa`](https://togithub.com/gomodule/redigo/commit/4c535aa56d60a1dddd457a8e63caa463bcb5a70b):
ci: fix go caching
([#&#8203;667](https://togithub.com/gomodule/redigo/issues/667))
([@&#8203;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
([#&#8203;664](https://togithub.com/gomodule/redigo/issues/664))
([@&#8203;stevenh](https://togithub.com/stevenh))

##### Continuous Integration

-
[`cfabb1f`](https://togithub.com/gomodule/redigo/commit/cfabb1f017433cdf852a4841a8c0125c48275c0b):
ci: remove deprecated goreleaser option
([#&#8203;663](https://togithub.com/gomodule/redigo/issues/663))
([@&#8203;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
([#&#8203;660](https://togithub.com/gomodule/redigo/issues/660))
([@&#8203;vasayxtx](https://togithub.com/vasayxtx))

##### Bug fixes

-
[`78e255f`](https://togithub.com/gomodule/redigo/commit/78e255f9bd2ae9c9885793a751f42f5698a5da8c):
fix: test goroutine leaks
([#&#8203;643](https://togithub.com/gomodule/redigo/issues/643))
([@&#8203;stevenh](https://togithub.com/stevenh))

##### Chores

-
[`9f0d2e9`](https://togithub.com/gomodule/redigo/commit/9f0d2e92e55d22b4c6d05bf8528ae90ed7fea855):
chore: remove debug check
([#&#8203;659](https://togithub.com/gomodule/redigo/issues/659))
([@&#8203;stevenh](https://togithub.com/stevenh))
-
[`8b1c13e`](https://togithub.com/gomodule/redigo/commit/8b1c13e0376bc43a2443a0b312567718b4afbcd9):
chore: run test server with enable-debug-command
([#&#8203;654](https://togithub.com/gomodule/redigo/issues/654))
([@&#8203;elboulangero](https://togithub.com/elboulangero))
-
[`a60882b`](https://togithub.com/gomodule/redigo/commit/a60882bf9e77d7f428bdfa7e27516979d833f663):
chore: update testify
([#&#8203;653](https://togithub.com/gomodule/redigo/issues/653))
([@&#8203;stevenh](https://togithub.com/stevenh))
-
[`9129745`](https://togithub.com/gomodule/redigo/commit/91297458446615564ead7370d273480ccd2120f3):
chore: update github actions and fix tests
([#&#8203;657](https://togithub.com/gomodule/redigo/issues/657))
([@&#8203;stevenh](https://togithub.com/stevenh))

##### Continuous Integration

-
[`1bfd3c1`](https://togithub.com/gomodule/redigo/commit/1bfd3c16b111e999b1ba506ad0613c8322a97848):
ci: add goreleaser, update action and go versions
([#&#8203;662](https://togithub.com/gomodule/redigo/issues/662))
([@&#8203;stevenh](https://togithub.com/stevenh))

#### New Contributors

- [@&#8203;elboulangero](https://togithub.com/elboulangero) made their
first contribution in
[gomodule/redigo#654
- [@&#8203;vasayxtx](https://togithub.com/vasayxtx) made their first
contribution in
[gomodule/redigo#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants