Skip to content
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

Rewrite core_plugin_test.py to use DB import mode instead of tf.contrib DB writer #3146

Merged
merged 8 commits into from
Jan 17, 2020

Conversation

nfelt
Copy link
Contributor

@nfelt nfelt commented Jan 17, 2020

This removes the tf.contrib.summary.create_db_writer() dependency from core_plugin_test.py, which partially addresses #1718 and #1705, and reverts the applicable part of #3143 (a temporary fix).

I've preserved most of the test coverage of the underlying DB-reading code by changing the test data population strategy to instead just use the DbImportMultiplexer logic that already exists within TensorBoard. That logic doesn't set started_time so we lose some coverage in that the test that specifically tests that behavior is now logdir-only, because it didn't seem worth the trouble to get it to keep working.

I also refactored the rest of the tests a little bit to remove cruft and reorganize the test cases a little more logically. Ultimately a lot of this should be cleaned up further as part of #2573. (And ultimately we should either drop the DB reading logic entirely or encapsulate it inside a DataProvider, but that's a battle for another day.)

@nfelt nfelt requested review from stephanwlee and removed request for wchargin January 17, 2020 00:46
self.assertEqual(parsed_object, {"logdir": self.get_temp_dir()})


class CorePluginDbModeTest(tf.test.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

Before merge, would you kindly remind me how CorePluginDbMode differs from CorePluginDbImportMode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's basically the branch here:

DB import mode:


DB read-only mode:
# DB read-only mode, never load event logs.

Both modes exercise the SQL-based read path within the plugins, which is what we actually want to test. The difference is that DB read-only mode expects you to pass an existing SQLite DB file with the --db flag (and the old test was using the create_db_writer() code to create such a file), whereas the DB import mode takes a logdir and automatically imports the logdir event files into a temporary DB (without using create_db_writer() but instead implementing mostly equivalent behavior).

@nfelt nfelt merged commit f923a7c into tensorflow:master Jan 17, 2020
@nfelt nfelt deleted the remove-tf-contrib-summary-db-writer branch January 17, 2020 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants