Skip to content

Geode-8853: DUNIT tests for HSTRLEN command#5939

Merged
jdeppe-pivotal merged 8 commits intoapache:developfrom
ringles:GEODE-8853-integration-tests-HSTRLEN
Jan 26, 2021
Merged

Geode-8853: DUNIT tests for HSTRLEN command#5939
jdeppe-pivotal merged 8 commits intoapache:developfrom
ringles:GEODE-8853-integration-tests-HSTRLEN

Conversation

@ringles
Copy link
Copy Markdown
Contributor

@ringles ringles commented Jan 21, 2021

Add DUNIT test for HSTRLEN Redis command, promote to "supported".

Copy link
Copy Markdown
Member

@sabbey37 sabbey37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good! I always worry there are scenarios I'm forgetting about.

Comment on lines +202 to +261
@Test
public void testHStrlen_givenWrongNumberOfArguments() {
assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN))
.hasMessageContaining("wrong number of arguments");
assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1"))
.hasMessageContaining("wrong number of arguments");
assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1", "2", "3"))
.hasMessageContaining("wrong number of arguments");
}

Copy link
Copy Markdown
Member

@sabbey37 sabbey37 Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these! I made this comment in the HSETNX PR as well:
I know for most of the other commands (del, getset, exists, etc.) we check the error message more closely, like:

.hasMessage("ERR wrong number of arguments for 'get' command");

I'm not sure if it's necessary, but maybe we could do the same here to be consistent? I realize there are a few areas where we're still just checking wrong number of arguments. We could eventually change those in a different PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we want to change this? Or create a different PR for it? Or not change it? Or something else?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second this. It would be pretty awkward to return an error message for the wrong command

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved by f65f4ce

- test the error messages for hgetall and hstrlen more specifically
- fix an hgetall test that was testing the wrong command
@jdeppe-pivotal jdeppe-pivotal merged commit 3ddd9da into apache:develop Jan 26, 2021
demery-pivotal pushed a commit to demery-pivotal/geode that referenced this pull request Jan 29, 2021
- test the error messages for hgetall and hstrlen more specifically
- fix an hgetall test that was testing the wrong command

Co-authored-by: Ray Ingles <ringles@vmware.com>
Co-authored-by: Helena A. Bales <hbales@pivotal.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

redis Issues related to the geode-for-redis module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants