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

Integration tests for Playground CLI requests #731

Open
lucifercr07 opened this issue Sep 26, 2024 · 15 comments · May be fixed by DiceDB/playground-mono#62
Open

Integration tests for Playground CLI requests #731

lucifercr07 opened this issue Sep 26, 2024 · 15 comments · May be fixed by DiceDB/playground-mono#62

Comments

@lucifercr07
Copy link
Contributor

Description

DiceDB Playground is an interactive platform that allows users to experiment with DiceDB commands in a live environment, similar to the Go Playground. Users will be able to submit and execute commands directly through a web interface. The initial implementation will focus on enabling users to search for and trigger commands.
For more details about DiceDB playground you can check here.

As part of this task we need to enhance unit tests and integration tests for /cli API.
This task would be extension of #727

Details

Validation:

  • Validate the incoming request to ensure required parameters (key, value, COMMAND_NAME) are provided.
  • Ensure appropriate HTTP response codes are returned based on success or failure scenarios.

Testing:

  • Unit tests for the new /cli handler to cover success and failure scenarios.
  • Integration tests that send various DiceDB commands via the CLI endpoint and check for correct responses.
@lucifercr07
Copy link
Contributor Author

Dependent on #727

@karandixit10
Copy link
Contributor

Can I Take this up once it is implemented?

@lucifercr07
Copy link
Contributor Author

@karandixit10 assigned, thanks for contributing. Please let me know if any other details required. Also you can collaborate with assignee of other issue.

@lucifercr07
Copy link
Contributor Author

@karandixit10 please let us know if you require any help with this.

@karandixit10
Copy link
Contributor

@karandixit10 please let us know if you require any help with this.

I'll try to add this by EOD

@karandixit10
Copy link
Contributor

Hi @lucifercr07 Do I have to create a mock DiceDB client to isolate the HTTP handler for Unit tests?

@karandixit10
Copy link
Contributor

And will the folder structure for integration_tests be same as DiceDB tests?

@lucifercr07
Copy link
Contributor Author

@karandixit10 we can keep the same.

@karandixit10
Copy link
Contributor

Hi @lucifercr07 for integration test I have to run DiceDB server in the terminal so will it fail in the CI when pushed?

@arpitbbhayani
Copy link
Contributor

Hello @karandixit10,

There has been no activity on this issue for the past 5 days.
It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

@karandixit10 karandixit10 removed their assignment Nov 13, 2024
@piyushhhxyz
Copy link
Contributor

piyushhhxyz commented Nov 24, 2024

Hi @lucifercr07 ,

I’ve reviewed the requirements for enhancing integration tests for the Playground CLI requests. I’m familiar with the dependencies and test structure for DiceDB. I’d like to take this up and ensure comprehensive validation, unit tests, and integration tests for the /cli API.

Please assign this issue to me so I can get started.

@yaten2302
Copy link

Hey @lucifercr07 @JyotinderSingh , I've a doubt regarding this issue, for writing the tests, those have to be written for playground-mono/internal/server/http.go, am I correct?

@JyotinderSingh
Copy link
Collaborator

Hey @lucifercr07 @JyotinderSingh , I've a doubt regarding this issue, for writing the tests, those have to be written for playground-mono/internal/server/http.go, am I correct?

Yes, just ensure all edge cases and happy paths are being tested

@yaten2302
Copy link

Thanks! I'll create a PR for this soon 👍

@yaten2302
Copy link

Hey @JyotinderSingh , I've a doubt in here, that while I was trying to test the CliHandler(...) func, my proposed workflow is as follows:

  1. Setup diceCmd as created in http.go at this line.
  2. I've then check that if err != nil, then I've to return an err.
  3. Then, on this line, as mentioned here, it executes the diceCmd, similarly this command must be executed in the test environment and any error should be returned(if present)?

Could you please have a look at my workflow and guide that if it's correct?

@yaten2302 yaten2302 linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants