-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add a test for search_string with spaces #22445
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
base: master
Are you sure you want to change the base?
Conversation
|
This PR does not modify any files shipped with the agent. To help streamline the release process, please consider adding the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
| instance = {'name': 'foo', 'search_string': ['foo bar'], 'exact_match': False} | ||
| process = ProcessCheck(common.CHECK_NAME, {}, [instance]) | ||
| pids = process.find_pids(instance['name'], instance['search_string'], instance['exact_match']) | ||
| assert pids == {123} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we run the check rather than find_pids and assert the metrics emitted? That way the test will still work even if we refactor out find_pids?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!! i think you can remove line 254 and 255 now!
What does this PR do?
Adds a test to verify the use case where the
search_stringproperty contains spaces.Motivation
Our current implementation already support this use case, it's good to add to protect it from regressions and to serve as documentation.
Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged