We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am writing unit tests to test our pipeline code. We ran into an issue that a BeforePipelineProcess hook is propagating the first error to all CMDs.
BeforePipelineProcess
Example code:
` redisDB, redisMock := redismock.NewClientMock() redisMock.ExpectGet("key1").SetErr(Errors.New("error")) redisMock.ExpectGet("key2").SetVal("{"key":"key2","value":"value2"}")
`
when using this setup for my mock client with the following code:
pipeline := c.client.Pipeline() defer pipeline.Close() redisResults := make([]*redis.StringCmd, len(keys)) for i, key := range keys { redisResults[i] = pipeline.Get(ctx, key) } _, _ = pipeline.Exec(ctx)
I see that redisResults has "error" for all stringCmd results, instead of just the first CMD for key1.
key1
We tested the same code with a redis instance and got the expected result of the first cmd returning an error but the second being nil.
The text was updated successfully, but these errors were encountered:
I experience the same error
Sorry, something went wrong.
this problem is made by the go-redis, take a look at code here
No branches or pull requests
I am writing unit tests to test our pipeline code. We ran into an issue that a
BeforePipelineProcess
hook is propagating the first error to all CMDs.Example code:
`
redisDB, redisMock := redismock.NewClientMock()
redisMock.ExpectGet("key1").SetErr(Errors.New("error"))
redisMock.ExpectGet("key2").SetVal("{"key":"key2","value":"value2"}")
`
when using this setup for my mock client with the following code:
pipeline := c.client.Pipeline() defer pipeline.Close() redisResults := make([]*redis.StringCmd, len(keys)) for i, key := range keys { redisResults[i] = pipeline.Get(ctx, key) } _, _ = pipeline.Exec(ctx)
I see that redisResults has "error" for all stringCmd results, instead of just the first CMD for
key1
.We tested the same code with a redis instance and got the expected result of the first cmd returning an error but the second being nil.
The text was updated successfully, but these errors were encountered: