From 1d2dacf85963460a351c6aa532de830d57be57a0 Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Tue, 12 Feb 2019 09:24:17 -0800 Subject: [PATCH 1/6] Add plugin and compat tests for tensorboard-notf target --- .travis.yml | 7 +++ tensorboard/plugins/audio/BUILD | 22 +++++++ tensorboard/plugins/custom_scalar/BUILD | 21 +++++++ tensorboard/plugins/distribution/BUILD | 23 +++++++ tensorboard/plugins/graph/BUILD | 21 +++++++ tensorboard/plugins/histogram/BUILD | 22 +++++++ tensorboard/plugins/image/BUILD | 21 +++++++ tensorboard/plugins/pr_curve/BUILD | 20 ++++++ tensorboard/plugins/projector/BUILD | 19 ++++++ .../projector/projector_plugin_test.py | 62 ++++++++++++------- tensorboard/plugins/scalar/BUILD | 21 +++++++ tensorboard/plugins/text/BUILD | 21 +++++++ 12 files changed, 258 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0b4ed5c59..5e7e099fda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,9 @@ before_install: - chmod +x "${bazel_binary}" - sudo mv "${bazel_binary}" /usr/local/bin/bazel + # Fix Boto and Travis issue https://github.com/travis-ci/travis-ci/issues/7940 + - sudo rm -f /etc/boto.cfg + # Storing build artifacts in this directory helps Travis cache them. This # will sometimes cut latency in half, when we're lucky. - echo "startup --output_base=${HOME}/.bazel-output-base" >>~/.bazelrc @@ -94,10 +97,12 @@ before_install: - echo "test --action_env=PATH" >>~/.bazelrc install: + - pip install boto3==1.9.86 - pip install flake8==3.5.0 - pip install futures==3.1.1 - pip install grpcio==1.6.3 - pip install mock==2.0.0 + - pip install moto==1.3.7 - pip install yamllint==1.5.0 - pip install -I "${TF_VERSION_ID}" @@ -121,6 +126,8 @@ script: - bazel fetch //tensorboard/... - bazel build //tensorboard/... - bazel test //tensorboard/... + # Run manual S3 test + - bazel test //tensorboard/compat/tensorflow_stub:gfile_s3_test - bazel run //tensorboard/pip_package:build_pip_package -- --tf-version "${TF_VERSION_ID}" --smoke after_script: diff --git a/tensorboard/plugins/audio/BUILD b/tensorboard/plugins/audio/BUILD index 0f4fb14a5e..29dc10b0e5 100644 --- a/tensorboard/plugins/audio/BUILD +++ b/tensorboard/plugins/audio/BUILD @@ -45,6 +45,28 @@ py_test( ], ) +py_test( + name = "audio_plugin_notf_test", + size = "small", + srcs = ["audio_plugin_test.py"], + main = "audio_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":audio_plugin", + ":summary", + "//tensorboard:expect_numpy_installed", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "summary", srcs = ["summary.py"], diff --git a/tensorboard/plugins/custom_scalar/BUILD b/tensorboard/plugins/custom_scalar/BUILD index d704e49522..ba506061b8 100644 --- a/tensorboard/plugins/custom_scalar/BUILD +++ b/tensorboard/plugins/custom_scalar/BUILD @@ -87,6 +87,27 @@ py_test( ], ) +py_test( + name = "custom_scalars_plugin_test_notf", + size = "small", + srcs = ["custom_scalars_plugin_test.py"], + main = "custom_scalars_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":custom_scalars_plugin", + ":protos_all_py_pb2", + ":summary", + "//tensorboard:expect_numpy_installed", + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/plugins/scalar:scalars_plugin", + "//tensorboard/plugins/scalar:summary", + "//tensorboard/util:test_util", + ], +) + tb_proto_library( name = "protos_all", srcs = ["layout.proto"], diff --git a/tensorboard/plugins/distribution/BUILD b/tensorboard/plugins/distribution/BUILD index d721bd2131..ea2d89d52c 100644 --- a/tensorboard/plugins/distribution/BUILD +++ b/tensorboard/plugins/distribution/BUILD @@ -43,6 +43,29 @@ py_test( ], ) +py_test( + name = "distributions_plugin_notf_test", + size = "small", + srcs = ["distributions_plugin_test.py"], + main = "distributions_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":compressor", + ":distributions_plugin", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_accumulator", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/plugins/histogram:summary", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "compressor", srcs = ["compressor.py"], diff --git a/tensorboard/plugins/graph/BUILD b/tensorboard/plugins/graph/BUILD index 7ce99cd40a..57f134c2d5 100644 --- a/tensorboard/plugins/graph/BUILD +++ b/tensorboard/plugins/graph/BUILD @@ -63,6 +63,27 @@ py_test( ], ) +py_test( + name = "graphs_plugin_notf_test", + size = "small", + srcs = ["graphs_plugin_test.py"], + main = "graphs_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":graphs_plugin", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/compat/proto:protos_all_py_pb2", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "keras_util", srcs = ["keras_util.py"], diff --git a/tensorboard/plugins/histogram/BUILD b/tensorboard/plugins/histogram/BUILD index 46728087ed..2dbe172abb 100644 --- a/tensorboard/plugins/histogram/BUILD +++ b/tensorboard/plugins/histogram/BUILD @@ -47,6 +47,28 @@ py_test( ], ) +py_test( + name = "histograms_plugin_notf_test", + size = "small", + srcs = ["histograms_plugin_test.py"], + main = "histograms_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":histograms_plugin", + ":summary", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_accumulator", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "metadata", srcs = ["metadata.py"], diff --git a/tensorboard/plugins/image/BUILD b/tensorboard/plugins/image/BUILD index fad55050d7..d10b2ea6ec 100644 --- a/tensorboard/plugins/image/BUILD +++ b/tensorboard/plugins/image/BUILD @@ -59,6 +59,27 @@ py_test( ], ) +py_test( + name = "images_plugin_test_notf", + size = "small", + srcs = ["images_plugin_test.py"], + main = "images_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":images_plugin", + ":summary", + "//tensorboard:expect_numpy_installed", + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "summary", srcs = ["summary.py"], diff --git a/tensorboard/plugins/pr_curve/BUILD b/tensorboard/plugins/pr_curve/BUILD index 5b26cfa5e9..32af2f32df 100644 --- a/tensorboard/plugins/pr_curve/BUILD +++ b/tensorboard/plugins/pr_curve/BUILD @@ -56,6 +56,26 @@ py_test( ], ) +py_test( + name = "pr_curves_plugin_test_notf", + size = "medium", # tf integration test + srcs = ["pr_curves_plugin_test.py"], + main = "pr_curves_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":metadata", + ":pr_curve_demo_lib", + ":pr_curves_plugin", + "//tensorboard:expect_numpy_installed", + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_library( name = "summary", srcs = ["summary.py"], diff --git a/tensorboard/plugins/projector/BUILD b/tensorboard/plugins/projector/BUILD index 7ea52ac9c1..603d60d4be 100644 --- a/tensorboard/plugins/projector/BUILD +++ b/tensorboard/plugins/projector/BUILD @@ -68,6 +68,25 @@ py_test( ], ) +py_test( + name = "projector_plugin_test_notf", + size = "small", + srcs = ["projector_plugin_test.py"], + main = "projector_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":projector_plugin", + "//tensorboard:expect_numpy_installed", + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + ], +) + tb_proto_library( name = "protos_all", srcs = glob(["*.proto"]), diff --git a/tensorboard/plugins/projector/projector_plugin_test.py b/tensorboard/plugins/projector/projector_plugin_test.py index 73f7a88e1e..1eeae95ba9 100644 --- a/tensorboard/plugins/projector/projector_plugin_test.py +++ b/tensorboard/plugins/projector/projector_plugin_test.py @@ -35,6 +35,7 @@ from tensorboard.backend.event_processing import plugin_event_multiplexer as event_multiplexer # pylint: disable=line-too-long from tensorboard.compat.proto import event_pb2 from tensorboard.compat.proto import summary_pb2 +from tensorboard.compat import tf as tf_compat from tensorboard.plugins import base_plugin from tensorboard.plugins.projector import projector_config_pb2 from tensorboard.plugins.projector import projector_plugin @@ -42,6 +43,8 @@ tf.compat.v1.disable_v2_behavior() +USING_REAL_TF = tf_compat.__version__ != 'stub' + class ProjectorAppTest(tf.test.TestCase): @@ -58,7 +61,10 @@ def testRunsWithValidCheckpoint(self): self._GenerateProjectorTestData() self._SetupWSGIApp() run_json = self._GetJson('/data/plugin/projector/runs') - self.assertTrue(run_json) + if USING_REAL_TF: + self.assertTrue(run_json) + else: + self.assertFalse(run_json) def testRunsWithNoCheckpoint(self): self._SetupWSGIApp() @@ -76,6 +82,8 @@ def testRunsWithInvalidModelCheckpointPath(self): run_json = self._GetJson('/data/plugin/projector/runs') self.assertEqual(run_json, []) + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testRunsWithInvalidModelCheckpointPathInConfig(self): config_path = os.path.join(self.log_dir, 'projector_config.pbtxt') config = projector_config_pb2.ProjectorConfig() @@ -89,6 +97,8 @@ def testRunsWithInvalidModelCheckpointPathInConfig(self): run_json = self._GetJson('/data/plugin/projector/runs') self.assertEqual(run_json, []) + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testInfoWithValidCheckpointNoEventsData(self): self._GenerateProjectorTestData() self._SetupWSGIApp() @@ -112,21 +122,26 @@ def testInfoWithValidCheckpointAndEventsData(self): self._SetupWSGIApp() run_json = self._GetJson('/data/plugin/projector/runs') - self.assertTrue(run_json) - run = run_json[0] - info_json = self._GetJson('/data/plugin/projector/info?run=%s' % run) - self.assertItemsEqual(info_json['embeddings'], [{ - 'tensorShape': [1, 2], - 'tensorName': 'var1', - 'bookmarksPath': 'bookmarks.json' - }, { - 'tensorShape': [10, 10], - 'tensorName': 'var2' - }, { - 'tensorShape': [100, 100], - 'tensorName': 'var3' - }]) - + if USING_REAL_TF: + self.assertTrue(run_json) + run = run_json[0] + info_json = self._GetJson('/data/plugin/projector/info?run=%s' % run) + self.assertItemsEqual(info_json['embeddings'], [{ + 'tensorShape': [1, 2], + 'tensorName': 'var1', + 'bookmarksPath': 'bookmarks.json' + }, { + 'tensorShape': [10, 10], + 'tensorName': 'var2' + }, { + 'tensorShape': [100, 100], + 'tensorName': 'var3' + }]) + else: + self.assertFalse(run_json) + + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testTensorWithValidCheckpoint(self): self._GenerateProjectorTestData() self._SetupWSGIApp() @@ -171,6 +186,8 @@ def testBookmarksUnknownName(self): url = '/data/plugin/projector/bookmarks?run=.&name=unknown' self.assertEqual(self._Get(url).status_code, 400) + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testBookmarks(self): self._GenerateProjectorTestData() self._SetupWSGIApp() @@ -215,13 +232,14 @@ def testPluginIsActive(self): self.plugin._thread_for_determining_is_active.run() - # The plugin later finds that embedding data is available. - self.assertTrue(self.plugin.is_active()) + if USING_REAL_TF: + # The plugin later finds that embedding data is available. + self.assertTrue(self.plugin.is_active()) - # Subsequent calls to is_active should not start a new thread. The mock - # should only have been called once throughout this test. - self.assertTrue(self.plugin.is_active()) - mock.assert_called_once_with(thread) + # Subsequent calls to is_active should not start a new thread. The mock + # should only have been called once throughout this test. + self.assertTrue(self.plugin.is_active()) + mock.assert_called_once_with(thread) def testPluginIsNotActive(self): self._SetupWSGIApp() diff --git a/tensorboard/plugins/scalar/BUILD b/tensorboard/plugins/scalar/BUILD index 6b27591e9f..c09e6f9f2a 100644 --- a/tensorboard/plugins/scalar/BUILD +++ b/tensorboard/plugins/scalar/BUILD @@ -47,6 +47,27 @@ py_test( ], ) +py_test( + name = "scalars_plugin_notf_test", + size = "small", + srcs = ["scalars_plugin_test.py"], + main = "scalars_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":scalars_plugin", + ":summary", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_accumulator", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_binary( name = "scalars_demo", srcs = ["scalars_demo.py"], diff --git a/tensorboard/plugins/text/BUILD b/tensorboard/plugins/text/BUILD index a9d0909547..e356d1b76f 100644 --- a/tensorboard/plugins/text/BUILD +++ b/tensorboard/plugins/text/BUILD @@ -49,6 +49,27 @@ py_test( ], ) +py_test( + name = "text_plugin_notf_test", + size = "small", + srcs = ["text_plugin_test.py"], + main = "text_plugin_test.py", + srcs_version = "PY2AND3", + deps = [ + ":text_plugin", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test + "//tensorboard:expect_tensorflow_installed", + "//tensorboard:plugin_util", + "//tensorboard/backend:application", + "//tensorboard/backend/event_processing:event_multiplexer", + "//tensorboard/compat:no_tensorflow", + "//tensorboard/plugins:base_plugin", + "//tensorboard/util:test_util", + "@org_pocoo_werkzeug", + "@org_pythonhosted_six", + ], +) + py_binary( name = "text_demo", srcs = ["text_demo.py"], From 07755855999a96af5b0dd2458f3cd357dd8512b4 Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Thu, 14 Mar 2019 08:20:20 -0700 Subject: [PATCH 2/6] Import unittest for projector test --- tensorboard/plugins/projector/projector_plugin_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tensorboard/plugins/projector/projector_plugin_test.py b/tensorboard/plugins/projector/projector_plugin_test.py index 1eeae95ba9..eaf5ec3ae0 100644 --- a/tensorboard/plugins/projector/projector_plugin_test.py +++ b/tensorboard/plugins/projector/projector_plugin_test.py @@ -25,6 +25,7 @@ import os import numpy as np import tensorflow as tf +import unittest from werkzeug import test as werkzeug_test from werkzeug import wrappers From 4e5695fe41fe64b94d953466f2d6672f21381663 Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Thu, 14 Mar 2019 08:26:41 -0700 Subject: [PATCH 3/6] Missed some tests --- tensorboard/plugins/custom_scalar/BUILD | 3 ++- tensorboard/plugins/image/BUILD | 3 ++- tensorboard/plugins/pr_curve/BUILD | 3 ++- tensorboard/plugins/projector/BUILD | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tensorboard/plugins/custom_scalar/BUILD b/tensorboard/plugins/custom_scalar/BUILD index ba506061b8..1c6f60428e 100644 --- a/tensorboard/plugins/custom_scalar/BUILD +++ b/tensorboard/plugins/custom_scalar/BUILD @@ -88,7 +88,7 @@ py_test( ) py_test( - name = "custom_scalars_plugin_test_notf", + name = "custom_scalars_plugin_notf_test", size = "small", srcs = ["custom_scalars_plugin_test.py"], main = "custom_scalars_plugin_test.py", @@ -98,6 +98,7 @@ py_test( ":protos_all_py_pb2", ":summary", "//tensorboard:expect_numpy_installed", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/compat:no_tensorflow", diff --git a/tensorboard/plugins/image/BUILD b/tensorboard/plugins/image/BUILD index d10b2ea6ec..301a77c9b1 100644 --- a/tensorboard/plugins/image/BUILD +++ b/tensorboard/plugins/image/BUILD @@ -60,7 +60,7 @@ py_test( ) py_test( - name = "images_plugin_test_notf", + name = "images_plugin_notf_test", size = "small", srcs = ["images_plugin_test.py"], main = "images_plugin_test.py", @@ -69,6 +69,7 @@ py_test( ":images_plugin", ":summary", "//tensorboard:expect_numpy_installed", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", diff --git a/tensorboard/plugins/pr_curve/BUILD b/tensorboard/plugins/pr_curve/BUILD index 32af2f32df..2524cb3e8a 100644 --- a/tensorboard/plugins/pr_curve/BUILD +++ b/tensorboard/plugins/pr_curve/BUILD @@ -57,7 +57,7 @@ py_test( ) py_test( - name = "pr_curves_plugin_test_notf", + name = "pr_curves_plugin_notf_test", size = "medium", # tf integration test srcs = ["pr_curves_plugin_test.py"], main = "pr_curves_plugin_test.py", @@ -67,6 +67,7 @@ py_test( ":pr_curve_demo_lib", ":pr_curves_plugin", "//tensorboard:expect_numpy_installed", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/compat:no_tensorflow", diff --git a/tensorboard/plugins/projector/BUILD b/tensorboard/plugins/projector/BUILD index 603d60d4be..3375b830b2 100644 --- a/tensorboard/plugins/projector/BUILD +++ b/tensorboard/plugins/projector/BUILD @@ -69,7 +69,7 @@ py_test( ) py_test( - name = "projector_plugin_test_notf", + name = "projector_plugin_notf_test", size = "small", srcs = ["projector_plugin_test.py"], main = "projector_plugin_test.py", @@ -77,6 +77,7 @@ py_test( deps = [ ":projector_plugin", "//tensorboard:expect_numpy_installed", + # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", From ed22a684b10ae5b0448f0ff602b8fc7f529cd469 Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Thu, 14 Mar 2019 09:21:04 -0700 Subject: [PATCH 4/6] Wait a little longer for moto to install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e7e099fda..c80d9c8820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,7 @@ install: - pip install futures==3.1.1 - pip install grpcio==1.6.3 - pip install mock==2.0.0 - - pip install moto==1.3.7 + - pip install --default-timeout=300 moto==1.3.7 - pip install yamllint==1.5.0 - pip install -I "${TF_VERSION_ID}" From 23c78984b69ac43e4d3a8667dc9be1836110b137 Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Thu, 14 Mar 2019 18:05:50 -0700 Subject: [PATCH 5/6] Additional review changes --- tensorboard/plugins/audio/BUILD | 2 +- tensorboard/plugins/custom_scalar/BUILD | 2 +- tensorboard/plugins/distribution/BUILD | 2 +- tensorboard/plugins/graph/BUILD | 2 +- tensorboard/plugins/histogram/BUILD | 2 +- tensorboard/plugins/image/BUILD | 2 +- tensorboard/plugins/pr_curve/BUILD | 2 +- tensorboard/plugins/projector/BUILD | 2 +- .../projector/projector_plugin_test.py | 48 +++++++++---------- tensorboard/plugins/scalar/BUILD | 2 +- tensorboard/plugins/text/BUILD | 2 +- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tensorboard/plugins/audio/BUILD b/tensorboard/plugins/audio/BUILD index 29dc10b0e5..d3d69d330e 100644 --- a/tensorboard/plugins/audio/BUILD +++ b/tensorboard/plugins/audio/BUILD @@ -45,6 +45,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "audio_plugin_notf_test", size = "small", @@ -55,7 +56,6 @@ py_test( ":audio_plugin", ":summary", "//tensorboard:expect_numpy_installed", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", diff --git a/tensorboard/plugins/custom_scalar/BUILD b/tensorboard/plugins/custom_scalar/BUILD index 1c6f60428e..127565a60d 100644 --- a/tensorboard/plugins/custom_scalar/BUILD +++ b/tensorboard/plugins/custom_scalar/BUILD @@ -87,6 +87,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "custom_scalars_plugin_notf_test", size = "small", @@ -98,7 +99,6 @@ py_test( ":protos_all_py_pb2", ":summary", "//tensorboard:expect_numpy_installed", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/compat:no_tensorflow", diff --git a/tensorboard/plugins/distribution/BUILD b/tensorboard/plugins/distribution/BUILD index ea2d89d52c..862f8360f9 100644 --- a/tensorboard/plugins/distribution/BUILD +++ b/tensorboard/plugins/distribution/BUILD @@ -43,6 +43,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "distributions_plugin_notf_test", size = "small", @@ -52,7 +53,6 @@ py_test( deps = [ ":compressor", ":distributions_plugin", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_accumulator", diff --git a/tensorboard/plugins/graph/BUILD b/tensorboard/plugins/graph/BUILD index 57f134c2d5..9f95278674 100644 --- a/tensorboard/plugins/graph/BUILD +++ b/tensorboard/plugins/graph/BUILD @@ -63,6 +63,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "graphs_plugin_notf_test", size = "small", @@ -71,7 +72,6 @@ py_test( srcs_version = "PY2AND3", deps = [ ":graphs_plugin", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", diff --git a/tensorboard/plugins/histogram/BUILD b/tensorboard/plugins/histogram/BUILD index 2dbe172abb..8a80ecb636 100644 --- a/tensorboard/plugins/histogram/BUILD +++ b/tensorboard/plugins/histogram/BUILD @@ -47,6 +47,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "histograms_plugin_notf_test", size = "small", @@ -56,7 +57,6 @@ py_test( deps = [ ":histograms_plugin", ":summary", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_accumulator", diff --git a/tensorboard/plugins/image/BUILD b/tensorboard/plugins/image/BUILD index 301a77c9b1..be82c0491c 100644 --- a/tensorboard/plugins/image/BUILD +++ b/tensorboard/plugins/image/BUILD @@ -59,6 +59,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "images_plugin_notf_test", size = "small", @@ -69,7 +70,6 @@ py_test( ":images_plugin", ":summary", "//tensorboard:expect_numpy_installed", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", diff --git a/tensorboard/plugins/pr_curve/BUILD b/tensorboard/plugins/pr_curve/BUILD index 2524cb3e8a..2e69d477b1 100644 --- a/tensorboard/plugins/pr_curve/BUILD +++ b/tensorboard/plugins/pr_curve/BUILD @@ -56,6 +56,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "pr_curves_plugin_notf_test", size = "medium", # tf integration test @@ -67,7 +68,6 @@ py_test( ":pr_curve_demo_lib", ":pr_curves_plugin", "//tensorboard:expect_numpy_installed", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/compat:no_tensorflow", diff --git a/tensorboard/plugins/projector/BUILD b/tensorboard/plugins/projector/BUILD index 3375b830b2..0d1e6f1960 100644 --- a/tensorboard/plugins/projector/BUILD +++ b/tensorboard/plugins/projector/BUILD @@ -68,6 +68,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "projector_plugin_notf_test", size = "small", @@ -77,7 +78,6 @@ py_test( deps = [ ":projector_plugin", "//tensorboard:expect_numpy_installed", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_multiplexer", diff --git a/tensorboard/plugins/projector/projector_plugin_test.py b/tensorboard/plugins/projector/projector_plugin_test.py index eaf5ec3ae0..0f72d4ac8a 100644 --- a/tensorboard/plugins/projector/projector_plugin_test.py +++ b/tensorboard/plugins/projector/projector_plugin_test.py @@ -117,29 +117,28 @@ def testInfoWithValidCheckpointNoEventsData(self): 'tensorName': 'var3' }]) + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testInfoWithValidCheckpointAndEventsData(self): self._GenerateProjectorTestData() self._GenerateEventsData() self._SetupWSGIApp() run_json = self._GetJson('/data/plugin/projector/runs') - if USING_REAL_TF: - self.assertTrue(run_json) - run = run_json[0] - info_json = self._GetJson('/data/plugin/projector/info?run=%s' % run) - self.assertItemsEqual(info_json['embeddings'], [{ - 'tensorShape': [1, 2], - 'tensorName': 'var1', - 'bookmarksPath': 'bookmarks.json' - }, { - 'tensorShape': [10, 10], - 'tensorName': 'var2' - }, { - 'tensorShape': [100, 100], - 'tensorName': 'var3' - }]) - else: - self.assertFalse(run_json) + self.assertTrue(run_json) + run = run_json[0] + info_json = self._GetJson('/data/plugin/projector/info?run=%s' % run) + self.assertItemsEqual(info_json['embeddings'], [{ + 'tensorShape': [1, 2], + 'tensorName': 'var1', + 'bookmarksPath': 'bookmarks.json' + }, { + 'tensorShape': [10, 10], + 'tensorName': 'var2' + }, { + 'tensorShape': [100, 100], + 'tensorName': 'var3' + }]) # TODO(#2007): Cleanly separate out projector tests that require real TF @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') @@ -212,6 +211,8 @@ def _AssertTensorResponse(self, tensor_bytes, expected_tensor): expected_tensor.shape) self.assertTrue(np.array_equal(tensor, expected_tensor)) + # TODO(#2007): Cleanly separate out projector tests that require real TF + @unittest.skipUnless(USING_REAL_TF, 'Test only passes when using real TF') def testPluginIsActive(self): self._GenerateProjectorTestData() self._SetupWSGIApp() @@ -233,14 +234,13 @@ def testPluginIsActive(self): self.plugin._thread_for_determining_is_active.run() - if USING_REAL_TF: - # The plugin later finds that embedding data is available. - self.assertTrue(self.plugin.is_active()) + # The plugin later finds that embedding data is available. + self.assertTrue(self.plugin.is_active()) - # Subsequent calls to is_active should not start a new thread. The mock - # should only have been called once throughout this test. - self.assertTrue(self.plugin.is_active()) - mock.assert_called_once_with(thread) + # Subsequent calls to is_active should not start a new thread. The mock + # should only have been called once throughout this test. + self.assertTrue(self.plugin.is_active()) + mock.assert_called_once_with(thread) def testPluginIsNotActive(self): self._SetupWSGIApp() diff --git a/tensorboard/plugins/scalar/BUILD b/tensorboard/plugins/scalar/BUILD index c09e6f9f2a..ae162e3835 100644 --- a/tensorboard/plugins/scalar/BUILD +++ b/tensorboard/plugins/scalar/BUILD @@ -47,6 +47,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "scalars_plugin_notf_test", size = "small", @@ -56,7 +57,6 @@ py_test( deps = [ ":scalars_plugin", ":summary", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard/backend:application", "//tensorboard/backend/event_processing:event_accumulator", diff --git a/tensorboard/plugins/text/BUILD b/tensorboard/plugins/text/BUILD index e356d1b76f..c64f664428 100644 --- a/tensorboard/plugins/text/BUILD +++ b/tensorboard/plugins/text/BUILD @@ -49,6 +49,7 @@ py_test( ], ) +# TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test py_test( name = "text_plugin_notf_test", size = "small", @@ -57,7 +58,6 @@ py_test( srcs_version = "PY2AND3", deps = [ ":text_plugin", - # TODO(#2007): Remove this after pruning unnecessary TensorFlow deps in main test "//tensorboard:expect_tensorflow_installed", "//tensorboard:plugin_util", "//tensorboard/backend:application", From 22defa8e0dcf16378b2a6fd0c62fe801da9810ac Mon Sep 17 00:00:00 2001 From: Orion Reblitz-Richardson Date: Fri, 15 Mar 2019 07:46:46 -0700 Subject: [PATCH 6/6] Remove pip install timeout change for moto --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c80d9c8820..5e7e099fda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,7 @@ install: - pip install futures==3.1.1 - pip install grpcio==1.6.3 - pip install mock==2.0.0 - - pip install --default-timeout=300 moto==1.3.7 + - pip install moto==1.3.7 - pip install yamllint==1.5.0 - pip install -I "${TF_VERSION_ID}"