-
Notifications
You must be signed in to change notification settings - Fork 356
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
test: create a test suite for examples #597
Conversation
@yoavz let's add this to CircleCI? |
@brain-good this is an initial pass at having "unit" tests for examples, with the caveat that I wasn't quite able to get them running all in the same Python process. Let me know if this approach looks good to you and I'll add the Circle CI target and remove the redundant tests in |
Sounds good @yoavz , think the approach makes sense 👍 |
a78e1a6
to
894a4d5
Compare
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.
good stuff
Description
This PR creates a test suite associated with
examples
. It runs a minimal test on each example using--local --test
mode. It is slightly more heavyweight than our unit tests since every example runs in a separate Python process, but more portable than full integration tests since no Determined cluster is required.Run-time on my local macbook pro is 1 minute 42 seconds:
The runtime can likely further be improved by further optimizing
--local --test
mode with https://determinedai.atlassian.net/browse/DET-2931DET-3110
DET-2952
Test Plan
N/A
Commentary (optional)
I had initially aimed to set-up these as unit tests running sequentially in a single Python process with
test_one_batch
. However, I hit some problems with conflicting module namespaces in examples -- for example,fashion_mnist_tf_keras
andmnist_pytorch
have adata.py
module they import in their entrypoint module withimport data
. When executed sequentially in a single Python process, the second timeimport data
is called it still uses the initialdata
module and fails. I figured it would be easier to execute each model definition in a separate process instead of removing this restriction or hacking the Python module namespace in some way.