-
Notifications
You must be signed in to change notification settings - Fork 564
[FR] [DAC] Add Flag to Enable All Prebuilt Tests #3684
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
[FR] [DAC] Add Flag to Enable All Prebuilt Tests #3684
Conversation
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.
LGTM. Can you double check that we don't want to add any other tests?
For example:
# - tests.test_all_rules.TestValidRules.test_schema_and_dupes
# - tests.test_packages.TestRegistryPackage.test_registry_package_config
I don't recall exactly why those stood out, but I think they also fail with just the base setup-config
run.
"# To run all tests, set bypass to empty or leave this file commented out.", | ||
"", |
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.
Should this just be a \n ?
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.
Because of the return '\n'.join(lines)
, the "" is the equivalent to a a \n. This was just to clean up the text to potentially make it easier to add or subtract lines later.
Good catch, we should add some other tests to bypass, moving back to in progress to add them now 👍 |
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.
Don't forget to update the summary.
Done |
Issues
#3682
Summary
This PR changed the behavior of
setup-config
to by bypass the following unit tests (specific to Elastic package release version locking)It also introduces a flag
-e
to allow one to change this behavior to have these bypasses commented out to enable all unit tests.Testing
To test try making configs without the
-e
flag and with the flag. After this, runmake test
with your non--e
config specified through theCUSTOM_RULES_DIR
environment variable. Move at least one rule into the directory. (Optional but for more through testing) All tests should pass with rules or without any rules.python -m detection_rules custom-rules setup-config test-dir
Output
python -m detection_rules custom-rules setup-config -e test-dir-all
Output
make test
Output