tensorflow / tensorboard

TensorFlow's Visualization Toolkit
Apache License 2.0
6.7k stars 1.66k forks source link

No document for frontend unit tests #1184

Closed theyiwenliu closed 4 years ago

theyiwenliu commented 6 years ago

We havebazel test tensorboard/... for python tests, but currently there is no document for how to execute frontend unit tests.

e.g. how to execute tests under tensorboard/plugins/graph/tf_graph_common/test or tensorboard/plugins/audio/tf_audio_dashboard/test etc.

And I thought the BUILD file under tensorboard/plugins/audio/tf_audio_dashboard/test will tell Bazel to trigger the test, but from the output I didn't see this test was executed with bazel test tensorboard/....

Any comment or suggestion is appreciated.

jart commented 6 years ago

Our frontend testing story is something we've been actively working to improve, using rules_webtesting, for quite some time. We're in some respects constrained by our Travis testing environment, which we might replace. We'd welcome contributions that help us improve.

theyiwenliu commented 6 years ago

@jart Thanks for your reply, may I know how do you trigger the frontend tests with rules_webtesting? Like what is the exact command you are using?

jart commented 6 years ago

Try running bazel test //tensorboard/functionaltests:core_test. That should download Chromium and browser test from the command line, but it's always been flaky. So we sometimes do things like bazel run //tensorboard/components/vz_sorting/test and open the test html file in the browser, and then open the Chrome console to see if it passed.

theyiwenliu commented 6 years ago

I am trying to run tests for graph plugin but there is no BUILD file under tensorboard/plugins/graph/tf_graph_common/test, how do I to trigger these tests? Thanks in advance!

jart commented 6 years ago

FTFY #1193

jart commented 6 years ago

It's now merged. Test away my friend.

theyiwenliu commented 6 years ago

It works! Thanks for your efficiency! 👍

bileschi commented 4 years ago

bazel test //tensorboard/... should cover the front end tests as well. To exclude the python tests, run bazel query 'tests(//tensorboard/my/package/...)' to find the right tests plus bazel test TEST_TARGET once you've located it.

wchargin commented 4 years ago

What @bileschi says is correct. Additionally, all our web test targets have the webtest tag, so you can find them with a bazel query:

$ bazel query 'attr(tags, webtest, tests(//tensorboard/...))'
//tensorboard/webapp:karma_test_chromium-local
//tensorboard/plugins/projector/vz_projector/test:test_chromium
//tensorboard/plugins/hparams/tf_hparams_utils:test_chromium
//tensorboard/plugins/hparams/tf_hparams_scale_and_color_controls:test_chromium
//tensorboard/plugins/hparams/tf_hparams_query_pane:test_chromium
//tensorboard/plugins/hparams/tf_hparams_parallel_coords_plot:test_chromium
//tensorboard/plugins/hparams/tf_hparams_google_analytics_tracker:test_chromium
//tensorboard/plugins/histogram/tf_histogram_dashboard/test:test_chromium
//tensorboard/plugins/graph/tf_graph_common/test:test_chromium
//tensorboard/functionaltests:core_test_chromium
//tensorboard/components/vz_sorting/test:test_chromium
//tensorboard/components/vz_line_chart2/test:test_chromium
//tensorboard/components/tf_tensorboard/test:test_chromium
//tensorboard/components/tf_storage/test:test_chromium
//tensorboard/components/tf_paginated_view/test:test_chromium
//tensorboard/components/tf_color_scale/test:test_chromium
//tensorboard/components/tf_categorization_utils/test:test_chromium
//tensorboard/components/tf_backend/test:test_chromium
//tensorboard/components/experimental/plugin_util/test:test_chromium
//tensorboard/components/experimental/plugin_lib/test:test_chromium