-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactor tests for _ScalarBatchedRequestSender #3532
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
Conversation
Identify tests in uploader_test.py that seem to specifically target logic in _ScalarBatchedRequestSender and rewrite them to only use _ScalarBatchedRequestSender and none of the layers above it. This is a useful exercise for the work on _TensorBatchedRequestSender so we can more easily identify which tests need to be written for it. We could also consider refactoring _ScalarBatchedRequestSender to its own file.
| with self.assertRaises(uploader_lib.ExperimentNotFoundError): | ||
| uploader._upload_once() | ||
|
|
||
| def test_upload_preserves_wall_time(self): |
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 decided to just plain delete this test. I think it's already covered by test_wall_time_precision().
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.
+1
| self.assertEqual(tag_counts, {"loss": 2}) | ||
|
|
||
| def test_v1_summary_single_value(self): | ||
| def test_expands_multiple_values_in_event(self): |
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.
This is one place where the diff gets confusing.
- test_v1_summary_single_value() has been migrated to ScalarBatchedRequestSenderTest as test_v1_summary().
- test_v1_summary_multiple_value() is kept here but renamed to test_expands_multiple_values_in_event(), which I think is its real value.
bileschi
left a comment
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.
Thanks for refactoring this. On the whole these tests are complicated and difficult to follow - i'm sure you agree. I'm not sure I have a good suggestion for how to improve them though.
| with self.assertRaises(uploader_lib.ExperimentNotFoundError): | ||
| uploader._upload_once() | ||
|
|
||
| def test_upload_preserves_wall_time(self): |
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.
+1
) Identify tests in uploader_test.py that specifically target logic in _ScalarBatchedRequestSender and rewrite them to only use _ScalarBatchedRequestSender and none of the other layers in uploader.py. This is a useful exercise for the work on _TensorBatchedRequestSender. I was having a difficult time using _ScalarBatchedRequestSender tests to establish a pattern for testing _TensorBatchedRequestSender.
Identify tests in uploader_test.py that specifically target logic in _ScalarBatchedRequestSender and rewrite them to only use _ScalarBatchedRequestSender and none of the other layers in uploader.py. This is a useful exercise for the work on _TensorBatchedRequestSender. I was having a difficult time using _ScalarBatchedRequestSender tests to establish a pattern for testing _TensorBatchedRequestSender.
Identify tests in uploader_test.py that specifically target logic in _ScalarBatchedRequestSender and rewrite them to only use _ScalarBatchedRequestSender and none of the other layers in uploader.py.
This is a useful exercise for the work on _TensorBatchedRequestSender. I was having a difficult time using _ScalarBatchedRequestSender tests to establish a pattern for testing _TensorBatchedRequestSender.