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

fix: the logic to compare two slices should be changed #1100

Conversation

AkashKumar7902
Copy link
Member

Related Issue

  • Info about Issue or bug

Closes: #1099

Describe the changes you've made

changed the comparison logic to compare two slices in jsonMatch() function.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • 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

Please describe the tests(if any). Provide instructions how its affecting the coverage.

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

A clear and concise description of it.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • 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)

Original Updated
original screenshot updated screenshot

AkashKumar7902 and others added 30 commits October 7, 2023 16:19
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
…obal-noisy-parameters-in-the-response' into feat-add-support-to-configure-global-noisy-parameters-in-the-response
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
…obal-noisy-parameters-in-the-response' into feat-add-support-to-configure-global-noisy-parameters-in-the-response
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@AkashKumar7902
Copy link
Member Author

AkashKumar7902 commented Dec 5, 2023

@charankamarapu I Have made the changes

@AkashKumar7902
Copy link
Member Author

@charankamarapu I believe code snippets in https://keploy.io/docs/running-keploy/configuration-file/ need an update. Should I create an issue ?

@charankamarapu
Copy link
Member

what change is needed there?

@AkashKumar7902
Copy link
Member Author

AkashKumar7902 commented Dec 5, 2023

global noise field in yaml is now changed from string. So the value of the globalnoise field needs an update

@charankamarapu
Copy link
Member

Currenly this is present in the docs, what will it be changed to ..?

globalNoise: |-
       {
         "global": {
           "body": {},
           "header": {}
         },
         "test-sets": {
           "test-set-name": {
             "body": {},
             "header": {}
           }
         }
       }

@AkashKumar7902
Copy link
Member Author

AkashKumar7902 commented Dec 5, 2023

Also some new fields are/will be added in keploy-config.

@charankamarapu
Copy link
Member

Who ever adds the new fields will change the doc too. Have you added any new field..?

@charankamarapu
Copy link
Member

Currenly this is present in the docs, what will it be changed to ..?

globalNoise: |-
       {
         "global": {
           "body": {},
           "header": {}
         },
         "test-sets": {
           "test-set-name": {
             "body": {},
             "header": {}
           }
         }
       }

Got it. The key strings will not be there. Please go head and create the issue but create the PR only after this PR is merged.

Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Please address the comments

body: {}
header: {}
test-sets:
test-set-name:
Copy link
Member

Choose a reason for hiding this comment

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

I think we shouldn't give this test-set-name in the default config because people will just run it and keploy thinks test-set-name is name of the test set and it will search for test-set-name. Just write test-sets: and leave it . Above the globalNoise: write a comment that to use global noise please follow the guide at the end of the yaml.

CoverageReportPath string `json:"coverageReportPath" yaml:"coverageReportPath"` // directory path to store the coverage files
}

type Globalnoise struct {
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked the case where I dont give Testsets noise at all..? like this :

globalNoise:
    global:
      body: {}
      header: {}

If I don't give test-sets noise at all will it throw an error while converting from yaml to go struct.

In the same way if I just include this without header json will it throw an error or ignore it.

globalNoise:
    global:
      body: {}

Copy link
Member

Choose a reason for hiding this comment

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

I have tested this from my end it is working fine. Please resolve the other comment.

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@AkashKumar7902
Copy link
Member Author

@charankamarapu I have made the changes

@charankamarapu
Copy link
Member

hey @AkashKumar7902 , can you check why the github action is failing mostly because of changes in config file. Mostly due to backward compatability it was unable to detect noise I guess, can you check once.?

AkashKumar7902 and others added 7 commits December 11, 2023 19:00
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@charankamarapu
Copy link
Member

@AkashKumar7902 Is the PR ready for review or are there any changes..?

Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Please address the comments

global:
body: {}
header: {}
test-sets:
Copy link
Member

Choose a reason for hiding this comment

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

may be just remove this test-sets param from here, people can understand how to use it from comments below.

Copy link
Member Author

Choose a reason for hiding this comment

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

done !

Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Ship it!

@charankamarapu charankamarapu merged commit f27b82f into keploy:main Dec 14, 2023
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: the logic to compare two slices in jsonMatch() function should be changed.
3 participants