Skip to content

Conversation

@bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Apr 20, 2020

  • Motivation for features / changes

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 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.
@bmd3k bmd3k changed the title Refactor tests for )ScalarBatchedRequestSender Refactor tests for _ScalarBatchedRequestSender Apr 20, 2020
@bmd3k bmd3k marked this pull request as ready for review April 20, 2020 16:32
@bmd3k bmd3k requested a review from davidsoergel April 20, 2020 16:32
with self.assertRaises(uploader_lib.ExperimentNotFoundError):
uploader._upload_once()

def test_upload_preserves_wall_time(self):
Copy link
Contributor Author

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().

Copy link
Collaborator

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):
Copy link
Contributor Author

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.

@bmd3k bmd3k requested a review from bileschi April 22, 2020 13:10
Copy link
Collaborator

@bileschi bileschi left a 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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@bmd3k bmd3k merged commit 0aee979 into tensorflow:master Apr 22, 2020
caisq pushed a commit to caisq/tensorboard that referenced this pull request May 19, 2020
)

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.
caisq pushed a commit that referenced this pull request May 27, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants