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: example generate in config file #1863

Merged
merged 7 commits into from May 18, 2024
Merged

fix: example generate in config file #1863

merged 7 commits into from May 18, 2024

Conversation

Sonichigo
Copy link
Member

While adding the global noise in keploy config, i followed the the example that's generated at the end of the file and found couple of things missing. Filters are array now, so listing down like

#  filters:
#   - path: "/user/app"
#     urlMethods: ["GET"]
#     headers: {
#       "^asdf*": "^test"
#     }
#     host: "dc.services.visualstudio.com"

Doesn't work anymore as well as in global noise between body:{} and header: {} was missing due which the noise function wasn't working as expected

new example in config file is

# Example on using tests
#tests:
#  filters: [
# {
#     path: "/user/app"
#     urlMethods: ["GET"]
#     headers: {
#       "^asdf*": "^test"
#     },
#     host: "dc.services.visualstudio.com"
#   }
#  ]
# Example on using stubs
# stubs:
#  filters: [
#   { 
#     path: "/user/app",
#     port: 8080
#   },
#   {
#     port: 8081,
#     host: "dc.services.visualstudio.com"
#    },
#   {
#     port: 8081,
#     host: "dc.services.visualstudio.com",
#     path: "/user/app"
#    }
#   ]
# Example on using globalNoise
# globalNoise:
#   global:
#     body: {
#        # to ignore some values for a field,
#        # pass regex patterns to the corresponding array value
#        "url": ["https?://\S+", "http://\S+"],
#     },
#     header: {
#        # to ignore the entire field, pass an empty array
#        "Date": [],
#      }
#    # to ignore fields or the corresponding values for a specific test-set,
#    # pass the test-set-name as a key to the "test-sets" object and
#    # populate the corresponding "body" and "header" objects
#    test-sets:
#      test-set-1:
#        body: {
#          # ignore all the values for the "url" field
#          "url": []
#        }
#        header: {
#          # we can also pass the exact value to ignore for a field
#          "User-Agent": ["PostmanRuntime/7.34.0"]
#        }

Copy link
Member

@PranshuSrivastava PranshuSrivastava left a comment

Choose a reason for hiding this comment

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

LGTM!

@nehagup nehagup merged commit e08db68 into keploy:main May 18, 2024
16 of 18 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2024
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.

None yet

3 participants