-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rewrite core_plugin_test.py to use DB import mode instead of tf.contrib DB writer #3146
Conversation
self.assertEqual(parsed_object, {"logdir": self.get_temp_dir()}) | ||
|
||
|
||
class CorePluginDbModeTest(tf.test.TestCase): |
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.
Before merge, would you kindly remind me how CorePluginDbMode differs from CorePluginDbImportMode?
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.
It's basically the branch here:
DB import mode:
if flags.db_import: |
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).
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.)