-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat(clp-s): Add end to end search tests for clp-s. #668
Open
gibber9809
wants to merge
10
commits into
y-scope:main
Choose a base branch
from
gibber9809:clp-s-search-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+359
−42
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
62dba34
Move TestOutputCleaner to its own file
gibber9809 9dabf62
Add VectorOutputHandler for testing purposes
gibber9809 852e181
Fix bug preventing sfa from working in test
gibber9809 d1c28f5
Lint fix
gibber9809 c424c9c
Add boilerplate for clp-s end to end search tests
gibber9809 c31c531
Add initial set of search tests
gibber9809 9442edf
Suggestion from rabbit
gibber9809 f4b8dfc
Merge remote-tracking branch 'upstream/main' into clp-s-search-tests
gibber9809 765b85e
Update include guard
gibber9809 6cc937f
Add check for edgecase where set of results is correct, but some resu…
gibber9809 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef TESTS_TESTOUTPUTCLEANER_HPP | ||
#define TESTS_TESTOUTPUTCLEANER_HPP | ||
|
||
#include <filesystem> | ||
#include <string> | ||
#include <vector> | ||
|
||
/** | ||
* A class that deletes the directories and files created by test cases, both before and after each | ||
* test case where the class is instantiated. | ||
*/ | ||
class TestOutputCleaner { | ||
public: | ||
explicit TestOutputCleaner(std::vector<std::string> const& paths) : m_paths(paths) { | ||
delete_paths(); | ||
} | ||
|
||
~TestOutputCleaner() { delete_paths(); } | ||
|
||
// Delete copy & move constructors and assignment operators | ||
TestOutputCleaner(TestOutputCleaner const&) = delete; | ||
TestOutputCleaner(TestOutputCleaner&&) = delete; | ||
auto operator=(TestOutputCleaner const&) -> TestOutputCleaner& = delete; | ||
auto operator=(TestOutputCleaner&&) -> TestOutputCleaner& = delete; | ||
|
||
private: | ||
void delete_paths() const { | ||
for (auto const& path : m_paths) { | ||
std::filesystem::remove_all(path); | ||
} | ||
} | ||
gibber9809 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
std::vector<std::string> m_paths; | ||
}; | ||
|
||
#endif // TESTS_TESTOUTPUTCLEANER_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm curious why we need to turn off logging for test cases and why it's only used in
test-kql
andtest-sql
.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.
We have some test cases that ensure illegal kql expressions fail to parse (and will do the same for sql). Inside of our KQL parser we log whenever we encounter a parsing error. We turn off logging just so that running those tests doesn't fill the terminal with error messages about failed parsing.