diff options
author | Dan Smilkov <dsmilkov@gmail.com> | 2016-03-07 16:29:41 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-03-08 17:16:52 -0800 |
commit | 16f2a29fda4d9efc9d169e443edbcc326a20e162 (patch) | |
tree | cc96e3fcc42a9d671a8b031335e34bae7afbd0c9 /tensorflow/tensorboard | |
parent | 4e00949e5b7469b66505b37f965f36b66b7a41fc (diff) |
Fix (and cleanup) tests in TensorBoard and simplified build process.
Fixed things:
- The internal testing was not testing lib/js/node-radar and components/tf-categorizer.
- The external testing (gulp test) was not running any tests in lib/js/*, and also components/tf-categorizer.
- Now both systems test everything.
Cleaned things:
- Unified the html test files for external (gulp test) and internal testing into one file.
- running `wct` or `gulp test` (both commands are equivalent) runs the tests
- When debugging tests, run `wct -p -l chrome` to open a persistent chrome browser, where you can tweak code and immediately refresh the browser to see the new test results.
- Removed the unnecessary /// <reference path="" in ts files, since the typings are linked via tsconfig.json
- Reused the <tf-tensoboard-demo> in the existing demo page (tf-tensorboard/demo/index.html)
Change: 116601367
Diffstat (limited to 'tensorflow/tensorboard')
29 files changed, 108 insertions, 178 deletions
diff --git a/tensorflow/tensorboard/components/tf-categorizer/test/categorizerTest.ts b/tensorflow/tensorboard/components/tf-categorizer/test/categorizerTest.ts index 8f858becb2..ede6a1f5a3 100644 --- a/tensorflow/tensorboard/components/tf-categorizer/test/categorizerTest.ts +++ b/tensorflow/tensorboard/components/tf-categorizer/test/categorizerTest.ts @@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../categorizer.ts" /> var assert = chai.assert; module Categorizer { diff --git a/tensorflow/tensorboard/components/tf-categorizer/test/index.html b/tensorflow/tensorboard/components/tf-categorizer/test/index.html new file mode 100644 index 0000000000..fd4a097708 --- /dev/null +++ b/tensorflow/tensorboard/components/tf-categorizer/test/index.html @@ -0,0 +1,13 @@ +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script> + <script src="../../web-component-tester/browser.js"></script> + <link rel="import" href="../../tf-imports/d3.html"> +</head> +<body> + <script src="../categorizer.js"></script> + <script src="categorizerTest.js"></script> +</body> +</html> diff --git a/tensorflow/tensorboard/components/tf-dashboard-common/urlGenerator.ts b/tensorflow/tensorboard/components/tf-dashboard-common/urlGenerator.ts index 7148fd3fce..00c593a049 100644 --- a/tensorflow/tensorboard/components/tf-dashboard-common/urlGenerator.ts +++ b/tensorflow/tensorboard/components/tf-dashboard-common/urlGenerator.ts @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../plottable/plottable.d.ts" /> - module TF { export module Urls { export type RunTagUrlFn = (tag: string, run: string) => string; @@ -69,7 +66,21 @@ module TF { }; }; - export function demoRouter(dataDir: string): Router { + export function demoRouter(dataDir: string, + oldVersion = false): Router { + if (oldVersion) { + return { + runs: () => dataDir + "runs.json", + graph: (run) => dataDir + run + "-graph.pbtxt", + scalars: (tag, run) => { + return dataDir + run.split("_")[0] + ".json"; + }, + histograms: () => null, + compressedHistograms: () => null, + images: () => null, + individualImage: () => null + }; + } /* Retrieves static .json data generated by demo_from_server.py */ function demoRoute(route) { return function(tag, run) { diff --git a/tensorflow/tensorboard/components/tf-event-dashboard/dataCoordinator.ts b/tensorflow/tensorboard/components/tf-event-dashboard/dataCoordinator.ts index 489a2138f0..5407800710 100644 --- a/tensorflow/tensorboard/components/tf-event-dashboard/dataCoordinator.ts +++ b/tensorflow/tensorboard/components/tf-event-dashboard/dataCoordinator.ts @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../plottable/plottable.d.ts" /> - module TF { /* The DataCoordinator generates TF.Datasets for each run/tag combination, diff --git a/tensorflow/tensorboard/components/tf-event-dashboard/dataset.ts b/tensorflow/tensorboard/components/tf-event-dashboard/dataset.ts index 8ced6ad0e2..3677a300d1 100644 --- a/tensorflow/tensorboard/components/tf-event-dashboard/dataset.ts +++ b/tensorflow/tensorboard/components/tf-event-dashboard/dataset.ts @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../plottable/plottable.d.ts" /> - module TF { /* An extension of Plottable.Dataset that knows how to load data from a backend. */ diff --git a/tensorflow/tensorboard/components/tf-event-dashboard/tf-chart.ts b/tensorflow/tensorboard/components/tf-event-dashboard/tf-chart.ts index 05fcf6b3e9..d799c190cf 100644 --- a/tensorflow/tensorboard/components/tf-event-dashboard/tf-chart.ts +++ b/tensorflow/tensorboard/components/tf-event-dashboard/tf-chart.ts @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../plottable/plottable.d.ts" /> - module TF { type TFDatum = [number, number, number]; type tooltipMap = {[run: string]: string}; diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts index ed89706b45..b2f6d21598 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/graph.ts @@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="common.ts" /> module tf.graph { /** Delimiter used in node names to denote namespaces. */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/hierarchy.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/hierarchy.ts index 98f34bdd3f..af5c1e97b6 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/hierarchy.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/hierarchy.ts @@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="graph.ts" /> -/// <reference path="template.ts" /> - /** * Package for the Graph Hierarchy for TensorFlow graph. */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/layout.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/layout.ts index 0e7b1d17d5..0d9e5b53bf 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/layout.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/layout.ts @@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="graph.ts" /> -/// <reference path="render.ts" /> - module tf.graph.layout { /** Set of parameters that define the look and feel of the graph. */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/parser.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/parser.ts index f88da0dd33..6d1aa875ee 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/parser.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/parser.ts @@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="common.ts" /> module tf.graph.parser { /** diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts index 8d2cd098a3..96d485b0ed 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/render.ts @@ -12,14 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="graph.ts" /> -/// <reference path="hierarchy.ts" /> - /** * Package for the Render Hierarchy for TensorFlow graph. */ - module tf.graph.render { export type Point = {x: number, y: number}; diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/annotation.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/annotation.ts index 4301acc8d9..b601ee84a9 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/annotation.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/annotation.ts @@ -12,13 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../graph.ts" /> -/// <reference path="../render.ts" /> -/// <reference path="scene.ts" /> -/// <reference path="edge.ts" /> -/// <reference path="contextmenu.ts" /> - module tf.graph.scene.annotation { /** diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/edge.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/edge.ts index d0f1e8fad6..2938aa3f1d 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/edge.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/edge.ts @@ -12,11 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../graph.ts" /> -/// <reference path="../render.ts" /> -/// <reference path="scene.ts" /> - module tf.graph.scene.edge { /** Delimiter between dimensions when showing sizes of tensors. */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/minimap.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/minimap.ts index 72464c69c4..bd8917929f 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/minimap.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/minimap.ts @@ -12,9 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../common.ts" /> - module tf.scene { /** Show minimap when the viewpoint area is less than X% of the whole area. */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/node.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/node.ts index 6d467c348a..a08613d615 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/node.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/node.ts @@ -12,12 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../graph.ts" /> -/// <reference path="scene.ts" /> -/// <reference path="annotation.ts" /> -/// <reference path="contextmenu.ts" /> - module tf.graph.scene.node { /** diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/scene.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/scene.ts index 685ad646f7..b6eb3f7d81 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/scene/scene.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/scene/scene.ts @@ -12,12 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="../graph.ts" /> -/// <reference path="edge.ts" /> -/// <reference path="node.ts" /> -/// <reference path="../layout.ts" /> - module tf.graph.scene { /** Enums element class of objects in the scene */ diff --git a/tensorflow/tensorboard/components/tf-graph-common/lib/template.ts b/tensorflow/tensorboard/components/tf-graph-common/lib/template.ts index 0423e1c863..93d1540939 100644 --- a/tensorflow/tensorboard/components/tf-graph-common/lib/template.ts +++ b/tensorflow/tensorboard/components/tf-graph-common/lib/template.ts @@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ - -/// <reference path="graph.ts" /> -/// <reference path="hierarchy.ts" /> - module tf.graph.template { /** diff --git a/tensorflow/tensorboard/components/tf-tensorboard/demo/index.html b/tensorflow/tensorboard/components/tf-tensorboard/demo/index.html index e97a1815c2..829769c3d0 100644 --- a/tensorflow/tensorboard/components/tf-tensorboard/demo/index.html +++ b/tensorflow/tensorboard/components/tf-tensorboard/demo/index.html @@ -1,40 +1,11 @@ <!DOCTYPE html> <html> - <head> - <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script> - <link rel="import" href="../tf-tensorboard.html"> +<head> + <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script> + <link rel="import" href="../tf-tensorboard-demo.html"> <link rel="stylesheet" type="text/css" href="../../../lib/css/global.css"> - <title>TensorBoard Demo</title> - </head> - <body> - <base href="/"> - <dom-module id="x-demo"> - <template> - <tf-tensorboard - id="demo" - router="[[demoRouter]]"> - </tf-tensorboard> - </template> - <script> - var dataDir = "components/tf-tensorboard/demo/data/"; - var demoRouter = { - runs: function() { return dataDir + "runs.json";}, - graph: function(run) {return dataDir + run + "-graph.pbtxt";}, - scalars: function(tag, run) { - return dataDir + run.split("_")[0] + ".json"; - }, - }; - Polymer({ - is: "x-demo", - properties: { - demoRouter: { - type: Object, - value: demoRouter, - }, - }, - }); - </script> - </dom-module> - <x-demo></x-demo> - </body> +</head> +<body> + <tf-tensorboard-demo old-version="true" data-dir="data/"></tf-tensorboard-demo> +</body> </html> diff --git a/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard-demo.html b/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard-demo.html index 8fe248aff0..abed65ef66 100644 --- a/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard-demo.html +++ b/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard-demo.html @@ -9,6 +9,7 @@ json data from a "dataDir" rather than connecting to a live backend. <tf-tensorboard id="tensorboard" router="[[_demoRouter]]" + no-hash="[[noHash]]" ></tf-tensorboard> <style> :host { @@ -23,15 +24,27 @@ json data from a "dataDir" rather than connecting to a live backend. properties: { _demoRouter: { type: Object, - computed: "_makeDemoRouter(dataDir)", + computed: "_makeDemoRouter(dataDir, oldVersion)", }, dataDir: { type: String, value: "data", }, + // To use the old version of the router which can serve the + // demo/data folder that is checked into the repository. + oldVersion: { + type: Boolean, + value: false + }, + // If true, tab switching in TensorBoard will not update + // location hash. Hash update interferes with selenium tests. + noHash: { + type: Boolean, + value: false + } }, - _makeDemoRouter: function(dataDir) { - return TF.Urls.demoRouter(dataDir); + _makeDemoRouter: function(dataDir, oldVersion) { + return TF.Urls.demoRouter(dataDir, oldVersion); }, }); </script> diff --git a/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard.html b/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard.html index bfcbb7ae5f..1c5ff47564 100644 --- a/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard.html +++ b/tensorflow/tensorboard/components/tf-tensorboard/tf-tensorboard.html @@ -20,11 +20,11 @@ allows the user to toggle between various dashboards. <paper-toolbar id="toolbar"> <div id="toolbar-content"> <div class="toolbar-title">TensorBoard</div> - <paper-tabs selected="0" noink class="tabs" id="tabs"> - <paper-tab data-mode="events" on-click="changeMode">Events</paper-tab> - <paper-tab data-mode="images" on-click="changeMode">Images</paper-tab> - <paper-tab data-mode="graphs" on-click="changeMode">Graph</paper-tab> - <paper-tab data-mode="histograms" on-click="changeMode">Histograms</paper-tab> + <paper-tabs selected="{{modeIndex}}" noink class="tabs" id="tabs"> + <paper-tab data-mode="events">Events</paper-tab> + <paper-tab data-mode="images">Images</paper-tab> + <paper-tab data-mode="graphs">Graph</paper-tab> + <paper-tab data-mode="histograms">Histograms</paper-tab> </paper-tabs> </div> </paper-toolbar> @@ -111,14 +111,24 @@ allows the user to toggle between various dashboards. type: Object, value: TF.Urls.productionRouter(), }, + // Which tab is selected (events, graph, images etc). mode: { type: String, - value: "events", + computed: '_getModeFromIndex(modeIndex)' }, + // If true, tab switching in TensorBoard will not update + // location hash. Hash update interferes with selenium tests. + noHash: { + type: Boolean, + value: false + } }, - changeMode: function(ev) { - var mode = ev.target.parentElement.getAttribute('data-mode'); - this._changeMode(mode, true); + _getModeFromIndex: function(modeIndex) { + var mode = this.tabs[modeIndex]; + if (!this.noHash) { + window.location.hash = mode; + } + return mode; }, eventDashboard: function(mode) { return mode === "events"; @@ -132,36 +142,26 @@ allows the user to toggle between various dashboards. histogramDashboard: function(mode) { return mode === "histograms"; }, - loadPreviousMode: function() { - this._changeMode(this._getMode(), false); - }, ready: function() { - this._changeMode(this._getMode(), true); - - var self = this; - window.addEventListener('hashchange', function(){ - self.loadPreviousMode(); + this.tabs = [].slice.call(this.querySelectorAll('paper-tab')).map(function(a) { + return a.dataset.mode; }); + this._getModeFromHash(); + window.addEventListener('hashchange', function() { + this._getModeFromHash(); + }.bind(this)); }, - _changeMode: function(mode, isNewState) { - this.mode = mode; - - // Change the selected tab - this.$.tabs.selected = this._tabs().indexOf(mode); - - if (isNewState){ - window.location.hash = mode; - } - }, - _getMode: function() { + _getModeFromHash: function() { // Return the mode as it is stored in the hash. - // If no mode can be found, default to the first tab. - var hash = window.location.hash; - return hash.length > 0 ? hash.slice(1, hash.length) : this._tabs()[0]; - }, - _tabs: function() { - var elts = Array.prototype.slice.call(this.querySelectorAll('paper-tab')); - return elts.map(function(elt){ return elt.getAttribute('data-mode')}); + var tabName = window.location.hash.trim().slice(1); + var modeIndex = this.tabs.indexOf(tabName); + if (modeIndex == -1 && this.modeIndex == null) { + // Selecting the first tab as default. + this.set('modeIndex', 0); + } + if (modeIndex != -1 && modeIndex != this.modeIndex) { + this.set('modeIndex', modeIndex); + } }, }); </script> diff --git a/tensorflow/tensorboard/components/tf-test/index.html b/tensorflow/tensorboard/components/tf-test/index.html deleted file mode 100644 index d551750e3c..0000000000 --- a/tensorflow/tensorboard/components/tf-test/index.html +++ /dev/null @@ -1,16 +0,0 @@ -<!doctype html> -<html> -<head> - <meta charset="utf-8"> - <script src="../web-component-tester/browser.js"></script> -</head> -<body> -<script> -// Run the tests for each main component in tensorboard. -WCT.loadSuites([ - '../tf-graph-common/test/index.html', - '../tf-graph-loader/test/index.html', -]); -</script> -</body> -</html> diff --git a/tensorflow/tensorboard/gulpfile.js b/tensorflow/tensorboard/gulpfile.js index dcc79f3008..6eeb24ddbe 100644 --- a/tensorflow/tensorboard/gulpfile.js +++ b/tensorflow/tensorboard/gulpfile.js @@ -98,8 +98,7 @@ gulp.task('compile.all', ['typings'], function() { }); gulp.task('test', ['tslint-strict', 'compile.all'], function(done) { - tester({suites: ['components/tf-test/'], - plugins: {local: {}, sauce: false}}, function(error) { + tester({}, function(error) { if (error) { // Pretty error for gulp. error = new Error(error.message || error); diff --git a/tensorflow/tensorboard/lib/js/backend/test/index.html b/tensorflow/tensorboard/lib/js/backend/test/index.html index 2305cf9426..7965ce6d0b 100644 --- a/tensorflow/tensorboard/lib/js/backend/test/index.html +++ b/tensorflow/tensorboard/lib/js/backend/test/index.html @@ -14,13 +14,9 @@ limitations under the License. =============================================================================--> <!doctype html> <html> -<!-- This test file has import paths that are suitable for gulp test and - direct loading in the browser --> <head> <meta charset="utf-8"> - <script src="../../../../../components/webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> - + <script src="../../web-component-tester/browser.js"></script> </head> <body> <script src="../../requestManager/requestManager.js"></script> diff --git a/tensorflow/tensorboard/lib/js/nanite/test/index.html b/tensorflow/tensorboard/lib/js/nanite/test/index.html index 0ac18a1bf2..2a886afe62 100644 --- a/tensorflow/tensorboard/lib/js/nanite/test/index.html +++ b/tensorflow/tensorboard/lib/js/nanite/test/index.html @@ -1,13 +1,10 @@ <!doctype html> <html> -<!-- This test file has import paths that are suitable for gulp test and - direct loading in the browser --> <head> <meta charset="utf-8"> - <script src="../../../../../components/webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> - <link rel="import" href="../../../../../components/polymer/polymer.html"> - + <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script> + <script src="../../web-component-tester/browser.js"></script> + <link rel="import" href="../../polymer/polymer.html"> </head> <body> <script src="../nanite.js"></script> diff --git a/tensorflow/tensorboard/lib/js/nanite/test/naniteTest.ts b/tensorflow/tensorboard/lib/js/nanite/test/naniteTest.ts index ecc792944e..ba9dce0f57 100644 --- a/tensorflow/tensorboard/lib/js/nanite/test/naniteTest.ts +++ b/tensorflow/tensorboard/lib/js/nanite/test/naniteTest.ts @@ -14,11 +14,9 @@ limitations under the License. ==============================================================================*/ var assert = chai.assert; declare function fixture(id: string): void; -declare module HTMLImports { - export function whenReady(f: Function): void; -} + module TF.Nanite { - HTMLImports.whenReady(function() { + window.HTMLImports.whenReady(function() { Polymer({ is: "test-element", properties: { diff --git a/tensorflow/tensorboard/lib/js/node-radar/test/index.html b/tensorflow/tensorboard/lib/js/node-radar/test/index.html index afb21ba15f..83c3018ed2 100644 --- a/tensorflow/tensorboard/lib/js/node-radar/test/index.html +++ b/tensorflow/tensorboard/lib/js/node-radar/test/index.html @@ -1,12 +1,8 @@ - <!doctype html> <html> - <!-- This test file has import paths that are suitable for gulp test and - direct loading in the browser --> <head> <meta charset="utf-8"> - <script src="../../../../../components/webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> + <script src="../../web-component-tester/browser.js"></script> </head> <body> <script src="../nodeRadar.js"></script> diff --git a/tensorflow/tensorboard/lib/js/requestManager/test/index.html b/tensorflow/tensorboard/lib/js/requestManager/test/index.html index b9712e8daf..53487f1f58 100644 --- a/tensorflow/tensorboard/lib/js/requestManager/test/index.html +++ b/tensorflow/tensorboard/lib/js/requestManager/test/index.html @@ -2,8 +2,7 @@ <html> <head> <meta charset="utf-8"> - <script src="../../../../../components/webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> + <script src="../../web-component-tester/browser.js"></script> </head> <body> <script src="../requestManager.js"></script> diff --git a/tensorflow/tensorboard/package.json b/tensorflow/tensorboard/package.json index 1902bc4756..25bb35df67 100644 --- a/tensorflow/tensorboard/package.json +++ b/tensorflow/tensorboard/package.json @@ -25,7 +25,7 @@ "tslint": "^3.2.1", "typescript": "1.8.0", "vulcanize": "^1.14.0", - "web-component-tester": "~3.4.2", + "web-component-tester": "4.2.2", "gulp-header": "~1.7.1", "gulp-rename": "~1.2.2", "gulp-typings": "~1.1.0", diff --git a/tensorflow/tensorboard/wct.conf.json b/tensorflow/tensorboard/wct.conf.json new file mode 100644 index 0000000000..0a5c6c20b6 --- /dev/null +++ b/tensorflow/tensorboard/wct.conf.json @@ -0,0 +1,12 @@ +{ + "suites": [ + "components/tf-*/test", + "lib/js/*/test" + ], + "plugins": ["local"], + "webserver": { + "pathMappings": [ + {"/components/<basename>/lib/js": "components"} + ] + } +}
\ No newline at end of file |