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

#734: Http Integration tests for COMMAND and COMMAND/COUNT #899

Merged

Conversation

svkaizoku
Copy link
Contributor

@svkaizoku svkaizoku commented Oct 1, 2024

Fixes: #734

I will be splitting the implementation of this issue in multiple PR's.

The PR contains tests to for the below commands

  • COMMAND/COUNT : command_count_test.go
  • COMMAND: command_default_test.go

@svkaizoku svkaizoku marked this pull request as ready for review October 1, 2024 21:19
@svkaizoku
Copy link
Contributor Author

svkaizoku commented Oct 1, 2024

@lucifercr07 @pratikpandey21 , feel free to review this whenever free. Thanks :D

@svkaizoku svkaizoku changed the title Test/integration test command count master Integration tests for COMMAND and COMMAND/COUNT Oct 1, 2024
@svkaizoku svkaizoku changed the title Integration tests for COMMAND and COMMAND/COUNT Http Integration tests for COMMAND and COMMAND/COUNT Oct 1, 2024
@svkaizoku svkaizoku changed the title Http Integration tests for COMMAND and COMMAND/COUNT #734: Http Integration tests for COMMAND and COMMAND/COUNT Oct 1, 2024
@svkaizoku svkaizoku force-pushed the test/integration-test-command-count-master branch from a005df7 to 1db9e30 Compare October 4, 2024 15:25
@lucifercr07
Copy link
Contributor

@svkaizoku build is failing can you please have a look?

@svkaizoku svkaizoku force-pushed the test/integration-test-command-count-master branch from 3acac41 to 2f566d4 Compare October 11, 2024 17:37
@svkaizoku
Copy link
Contributor Author

@svkaizoku build is failing can you please have a look?

Yes, let me do it.

@svkaizoku
Copy link
Contributor Author

@lucifercr07 Done 👍

"gotest.tools/v3/assert"
)

func TestCommandCount(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add one more scenario for below case

redis> COMMAND COUNT 123
(error) wrong number of arguments for 'command|count' command

@lucifercr07
Copy link
Contributor

@svkaizoku please resolve comments and conflicts.

@svkaizoku
Copy link
Contributor Author

@lucifercr07 on it. Will do it today.

@lucifercr07
Copy link
Contributor

@svkaizoku build is failing, please have a look.

@svkaizoku
Copy link
Contributor Author

svkaizoku commented Oct 14, 2024

@svkaizoku build is failing, please have a look.

@lucifercr07

@svkaizoku build is failing, please have a look.

Hey @lucifercr07
I need to send empty body for the request. But i am not sure how to do it though.
{
name: "Command count should be positive",
commands: []HTTPCommand{
{Command: "COMMAND/COUNT", Body: map[string]interface{}{}},
},
expected: []interface{}{float64(123)},
}

If i do this, an Invalid HTTP request format error is coming. i have asked the same in discord, can you point me to an example if you know?

What is the use case for this error?

if len(jsonBody) == 0 {

Can i remove this?

@svkaizoku svkaizoku requested a review from lucifercr07 October 14, 2024 19:05
@svkaizoku
Copy link
Contributor Author

@svkaizoku build is failing, please have a look.

@lucifercr07

@svkaizoku build is failing, please have a look.

Hey @lucifercr07 I need to send empty body for the request. But i am not sure how to do it though. { name: "Command count should be positive", commands: []HTTPCommand{ {Command: "COMMAND/COUNT", Body: map[string]interface{}{}}, }, expected: []interface{}{float64(123)}, }

If i do this, an Invalid HTTP request format error is coming. i have asked the same in discord, can you point me to an example if you know?

What is the use case for this error?

if len(jsonBody) == 0 {

Can i remove this?

No need to remove it. Have updated ability to add empty body in tests.

@svkaizoku
Copy link
Contributor Author

svkaizoku commented Oct 15, 2024

@svkaizoku build is failing, please have a look.

@lucifercr07 it is fixed and no conflicts now. Can you take a look now?

@lucifercr07 lucifercr07 merged commit d203b97 into DiceDB:master Oct 16, 2024
2 checks passed
kakdeykaushik pushed a commit to kakdeykaushik/dice that referenced this pull request Oct 19, 2024
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.

Http Integration Tests: Create tests to support HTTP
2 participants