-
Notifications
You must be signed in to change notification settings - Fork 883
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
feat(AclFamily): add acl whoami command #1774
Conversation
kostasrim
commented
Aug 30, 2023
- add acl whoami
- add tests
@pytest.mark.asyncio | ||
async def test_acl_whoami(async_client): | ||
await async_client.execute_command("ACL SETUSER kostas >kk +@ALL ON") | ||
|
||
with pytest.raises(redis.exceptions.ResponseError): | ||
await async_client.execute_command("ACL WHOAMI WHO") | ||
|
||
result = await async_client.execute_command("ACL WHOAMI") | ||
assert result == "User is default" | ||
|
||
result = await async_client.execute_command("AUTH kostas kk") | ||
|
||
result = await async_client.execute_command("ACL WHOAMI") | ||
assert result == "User is kostas" |
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.
Please stop using pytests 😆
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.
I agree. This type of logic we test with unit tests
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.
I promise I will move these to units next week after the release ❤️
db96c72
to
828ce19
Compare
@@ -220,7 +218,7 @@ async def test_acl_deluser(df_server): | |||
|
|||
|
|||
script = """ | |||
for i = 1, 10000 do | |||
for i = 1, 100000 do |
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.
I slightly increased this to avoid flakes but what I run locally won't necessary reflect the gh runners since the machines we are running on the regressions tests are far more powerful than mine
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.
They're less powerful. The flakes I was worried about is that it setuser migth run to quickly