keploy icon indicating copy to clipboard operation
keploy copied to clipboard

[Feature]: Create a normalisation command in keploy CLI

Open SkySingh04 opened this issue 1 year ago • 10 comments

Related Issue

  • New CLI Command Feature

Closes: #1538

Describe the changes you've made

Added keploy normalise command to the Keploy CLI to allow users to normalise their test cases. The Function of the command is as follows:

  • The command checks for test-sets , test-cases and test-run flags from the CLI
  • The command reads YAML files containing test data and unmarshals it..
  • The command iterates over each failed test case in the test data and retrieves the corresponding test data from the struct.
  • The command then updates the expected response in the test case file with the actual response obtained
  • Finally, the program writes the updated YAML data back to the original testcase files.

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Code style update (formatting, local variables)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

Please let us know if any test cases are added

NIL

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

NA

Checklist:

  • [x] My code follows the style guidelines of this project.
  • [x] I have performed a self-review of my own code.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have made corresponding changes to the documentation.
  • [x] My changes generate no new warnings.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [ ] New and existing unit tests pass locally with my changes.

Screenshots (if any)

image image

SkySingh04 avatar Feb 17 '24 07:02 SkySingh04

@charankamarapu Kindly review this PR and let me know if this implementation works!

SkySingh04 avatar Feb 17 '24 07:02 SkySingh04

From the screenshot I can say there is a bit of feature missing. User should give the testcases and testSet name which user want to normalise.

charankamarapu avatar Feb 19 '24 18:02 charankamarapu

From the screenshot I can say there is a bit of feature missing. User should give the testcases and testSet name which user want to normalise.

Alright, if that is how we would want to implement this feature it should not be a problem at all. Will update asap and revert!

SkySingh04 avatar Feb 19 '24 18:02 SkySingh04

@charankamarapu Let me know if this implementation is ready to go or there is a need to further include more features in this!

SkySingh04 avatar Feb 20 '24 01:02 SkySingh04

@charankamarapu If the CI pipeline will require time to fix, this PR is ready to be merged

SkySingh04 avatar Mar 18 '24 06:03 SkySingh04

cool will do a review and let you know.

charankamarapu avatar Mar 18 '24 06:03 charankamarapu

@charankamarapu I have addressed the review comments. Looking forward to your review on them

SkySingh04 avatar Mar 25 '24 13:03 SkySingh04

@Akash-Singh04 if the comments are resolved feel free to resolve them, @charankamarapu would review the updated PR

shivamsouravjha avatar Apr 29 '24 11:04 shivamsouravjha

@shivamsouravjha Need some time to properly look into the refactored codebase to resolve the comments,

SkySingh04 avatar Apr 29 '24 19:04 SkySingh04

Sure thing @Akash-Singh04 in the meanwhile you can move it as a draft,

shivamsouravjha avatar Apr 30 '24 06:04 shivamsouravjha