-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Testing] Implementation of an updated testing framework #2187
Conversation
@@ -0,0 +1,97 @@ | |||
# An Updated Testing Framework |
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.
is this meant to be a migration doc, or long standing demonstrating the new framework? if the latter probably don't need as much framing around what changed
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.
More so a summary of the new framework and what we want to establish going forward in terms of testing structure. Maybe makes more sense in internal docs as the target are MLE?
from tests.testing_utils import parse_params | ||
|
||
|
||
CONFIGS_DIRECTORY = "tests/sparseml/export/transformers/generation_configs" |
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.
any reason we wouldn't want to use relative path here? hardcoding this would require us to always run from sparseml/
not that this is not always the case though...
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.
yah I kept the path from sparseml
as that is the directory used to run all gha tests
…e extra assert True, and log message for custom test failures
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 cool with using a mix of unit test and pytest, specially cause pytest can pick up unittest style tests. Good work on the documentation, really appreciate it.
Co-authored-by: Rahul Tuli <[email protected]>
Summary:
unittest.TestCase
base class andparameterized
modulecadence
field, which dictates how frequently the test is run (set through an environment variables) and thetest_type
(sanity, regression, or smoke) which for now is a config variable but we can easily swap to just use decorators, as being done with the samplesmoke
test addedCustomIntegrationTest
class which other integration tests can inherit and use to test custom scripts and custom test classes.unit
,custom
, andintegration
tests. Also introduce decorators to mark tests with certain package or compute environments requirements (e.grequires_torch
,requires_gpu
). These are described in a newtesting_utils.py
fileFor a summary of the changes, see
tests/docs/testing_framework.md
Testing
CustomIntegrationTest
class is theTestGenerationExportIntegrationCustom
and it can be found intest_generation_export.py
. This test class was tested using sample config/python files added undertests/sparseml/export/transformers/generation_configs
tests/sparseml/export/transformers/generation_configs/tiny_stories.yaml
Using
unittest
unittest
package. We can definitely keep pytest for the existing tests if there are strong feelings although I do find it easier to read and understand and we can easily use the packageparameterized
to get the same functionality (or even expanded functionality for classes, compared to pytest fixtures).