http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/app/utils/processor.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/utils/processor.js b/tez-ui/src/main/webapp/app/utils/processor.js new file mode 100644 index 0000000..6658579 --- /dev/null +++ b/tez-ui/src/main/webapp/app/utils/processor.js @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, 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. + */ + +import Ember from 'ember'; + +function getVibrantHSL(colorNum, totalColors) { + if (totalColors < 1){ + totalColors = 1; + } + return { + h: colorNum * (360 / totalColors) % 360, + s: 100 - (colorNum % 2) * 30, + l: 40 + }; +} + +export default Ember.Object.extend({ + + processCount: 0, + + startTime: 0, + endTime: 0, + + timeWindow: Ember.computed("startTime", "endTime", function () { + return Math.max(0, this.get("endTime") - this.get("startTime")); + }), + + createProcessColor: function (index, totalProcessCount) { + return getVibrantHSL(index, totalProcessCount || this.get("processCount")); + }, + + timeToPositionPercent: function (time) { + return ((time - this.get("startTime")) / this.get("timeWindow")) * 100; + } + +});
http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/app/utils/vertex-process.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/utils/vertex-process.js b/tez-ui/src/main/webapp/app/utils/vertex-process.js new file mode 100644 index 0000000..626cd22 --- /dev/null +++ b/tez-ui/src/main/webapp/app/utils/vertex-process.js @@ -0,0 +1,273 @@ +/*global more*/ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, 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. + */ + +import Ember from 'ember'; + +import Process from './process'; + +var MoreObject = more.Object; + +export default Process.extend({ + vertex: null, + + name: Ember.computed.oneWay("vertex.name"), + completeTime: Ember.computed.oneWay("vertex.endTime"), + + blockingEventName: "VERTEX_FINISHED", + + getVisibleProps: null, + + edgeHash: null, + + eventBars: [{ + fromEvent: "FIRST_TASK_STARTED", + toEvent: "LAST_TASK_FINISHED", + }, { + fromEvent: "DEPENDENT_VERTICES_COMPLETE", + toEvent: "LAST_TASK_FINISHED", + }], + + init: function () { + this._super(); + this.set("edgeHash", Ember.Object.create()); + }, + + eventsHash: Ember.computed("[email protected]", function () { + var events = {}, + eventsArr = this.get("vertex.events"); + + if(eventsArr) { + eventsArr.forEach(function (event) { + if(event.timestamp > 0) { + events[event.eventtype] = { + name: event.eventtype, + time: event.timestamp, + info: event.eventinfo + }; + } + }); + } + + return events; + }), + + events: Ember.computed("eventsHash", + "vertex.initTime", "vertex.startTime", "vertex.endTime", + "vertex.firstTaskStartTime", "vertex.lastTaskFinishTime", "unblockDetails", + function () { + var events = [], + eventsHash = this.get("eventsHash"), + + initTime = this.get("vertex.initTime"), + startTime = this.get("vertex.startTime"), + endTime = this.get("vertex.endTime"), + + firstTaskStartTime = this.get("vertex.firstTaskStartTime"), + lastTaskFinishTime = this.get("vertex.lastTaskFinishTime"), + unblockDetails = this.get("unblockDetails"); + + if(initTime > 0) { + eventsHash["VERTEX_INITIALIZED"] = { + name: "VERTEX_INITIALIZED", + time: initTime + }; + } + + if(startTime > 0) { + eventsHash["VERTEX_STARTED"] = { + name: "VERTEX_STARTED", + time: startTime + }; + } + + if(firstTaskStartTime > 0) { + eventsHash["FIRST_TASK_STARTED"] = { + name: "FIRST_TASK_STARTED", + time: firstTaskStartTime + }; + } + + if(unblockDetails && unblockDetails.time >= firstTaskStartTime) { + eventsHash["DEPENDENT_VERTICES_COMPLETE"] = { + name: "DEPENDENT_VERTICES_COMPLETE", + time: unblockDetails.time, + edge: unblockDetails.edge + }; + } + + if(lastTaskFinishTime > 0) { + eventsHash["LAST_TASK_FINISHED"] = { + name: "LAST_TASK_FINISHED", + time: lastTaskFinishTime + }; + } + + if(endTime > 0) { + eventsHash["VERTEX_FINISHED"] = { + name: "VERTEX_FINISHED", + time: endTime + }; + } + + MoreObject.forEach(eventsHash, function (key, value) { + events.push(value); + }); + + return events; + } + ), + + unblockDetails: Ember.computed("[email protected]", function () { + var blockers = this.get("blockers"), + data = { + time: 0 + }; + + if(blockers) { + blockers.every(function (currentBlocker) { + var blockerComplete = currentBlocker.get("completeTime"); + + if(!blockerComplete) { + this.blocker = undefined; + return false; + } + else if(blockerComplete > this.time) { + this.blocker = currentBlocker; + this.time = blockerComplete; + } + + return true; + }, data); + } + + if(data.blocker) { + return { + time: data.blocker.get("completeTime"), + edge: this.get("edgeHash").get(data.blocker.get("name")) + }; + } + }), + + getTipProperties: function (propHash, propArray) { + propArray = propArray || []; + + MoreObject.forEach(propHash, function (key, value) { + if(MoreObject.isString(value)) { + propArray.push({ + name: key, + value: value, + }); + } + else if (MoreObject.isNumber(value)) { + propArray.push({ + name: key, + value: value, + type: "number" + }); + } + }); + + return propArray; + }, + + getTooltipContents: function (type, options) { + var contents, + that = this, + vertexDescription; + + switch(type) { + case "consolidated-process": + vertexDescription = `Contribution ${options.contribution}%`; + /* falls through */ + case "event-bar": + case "process-line": + case "process-name": + let properties = this.getVisibleProps().map(function (definition) { + return { + name: definition.get("headerTitle"), + value: that.get("vertex").get(definition.get("contentPath")), + type: Ember.get(definition, "cellDefinition.type"), + format: Ember.get(definition, "cellDefinition.format") + }; + }); + + contents = [{ + title: this.get("name"), + properties: properties, + description: vertexDescription + }]; + break; + case "event": + var edge; + contents = options.events.map(function (event) { + var properties = [{ + name: "Time", + value: event.time, + type: "date" + }]; + + if(event.edge) { + edge = event.edge; + } + if(event.info) { + properties = this.getTipProperties(event.info, properties); + } + + return { + title: event.name, + properties: properties + }; + }, this); + + if(edge) { + let sourceClass = edge.edgeSourceClass || "", + destClass = edge.edgeDestinationClass || ""; + + contents.push({ + title: "Edge From Final Dependent Vertex", + properties: this.getTipProperties({ + "Input Vertex": edge.inputVertexName, + "Output Vertex": edge.outputVertexName, + "Data Movement": edge.dataMovementType, + "Data Source": edge.dataSourceType, + "Scheduling": edge.schedulingType, + "Source Class": sourceClass.substr(sourceClass.lastIndexOf(".") + 1), + "Destination Class": destClass.substr(destClass.lastIndexOf(".") + 1), + }) + }); + } + break; + } + + return contents; + }, + + consolidateStartTime: Ember.computed("vertex.firstTaskStartTime", + "unblockDetails.time", function () { + return Math.max( + this.get("vertex.firstTaskStartTime") || 0, + this.get("unblockDetails.time") || 0 + ); + }), + consolidateEndTime: Ember.computed.oneWay("vertex.endTime"), + + getConsolidateColor: function () { + return this.getBarColor(this.get("unblockDetails") ? 1 : 0); + }, + +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/blueprints/.jshintrc ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/blueprints/.jshintrc b/tez-ui/src/main/webapp/blueprints/.jshintrc new file mode 100644 index 0000000..33f4f6f --- /dev/null +++ b/tez-ui/src/main/webapp/blueprints/.jshintrc @@ -0,0 +1,6 @@ +{ + "predef": [ + "console" + ], + "strict": false +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js b/tez-ui/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js new file mode 100644 index 0000000..179c5e5 --- /dev/null +++ b/tez-ui/src/main/webapp/blueprints/entity-test/files/tests/unit/entities/__name__-test.js @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('entitie:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', { + // Specify the other units that are required for this test. + // needs: ['entitie:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/blueprints/entity-test/index.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/blueprints/entity-test/index.js b/tez-ui/src/main/webapp/blueprints/entity-test/index.js new file mode 100644 index 0000000..d89d9cd --- /dev/null +++ b/tez-ui/src/main/webapp/blueprints/entity-test/index.js @@ -0,0 +1,35 @@ +/*jshint node:true*/ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +var testInfo = require('ember-cli-test-info'); + +module.exports = { + description: 'Generate an entity unit test.', + + locals: function(options) { + return { + friendlyTestDescription: testInfo.description(options.entity.name, "Unit", "Entity") + }; + }, + + // afterInstall: function(options) { + // // Perform extra work here. + // } +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/blueprints/entity/files/app/entities/__name__.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/blueprints/entity/files/app/entities/__name__.js b/tez-ui/src/main/webapp/blueprints/entity/files/app/entities/__name__.js new file mode 100644 index 0000000..334868e --- /dev/null +++ b/tez-ui/src/main/webapp/blueprints/entity/files/app/entities/__name__.js @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import Entity from './entity'; + +export default Entity.extend({ +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/blueprints/entity/index.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/blueprints/entity/index.js b/tez-ui/src/main/webapp/blueprints/entity/index.js new file mode 100644 index 0000000..24e25ef --- /dev/null +++ b/tez-ui/src/main/webapp/blueprints/entity/index.js @@ -0,0 +1,31 @@ +/*jshint node:true*/ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +module.exports = { + description: 'Generate and entity', + + locals: function(options) { + return {}; + } + + // afterInstall: function(options) { + // // Perform extra work here. + // } +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/bower.json ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/bower.json b/tez-ui/src/main/webapp/bower.json index cc6577b..4b0d01b 100644 --- a/tez-ui/src/main/webapp/bower.json +++ b/tez-ui/src/main/webapp/bower.json @@ -1,32 +1,27 @@ { "name": "tez-ui", - "version": "0.0.1", - "license": "Apache2", "dependencies": { - "ember": "1.7.0", - "moment": "2.10.6", - "moment-timezone": "0.4.0", - "ember-data": "1.0.0-beta.11", - "ember-i18n": "2.9.0", - "bootstrap": "3.3.1", - "ember-json-mapper": "1.0.0", - "jquery-ui": "1.11", - "d3": "3.4.11", - "ember-addons.bs_for_ember": "~0.7.0", - "ember-table": "~0.2.4", - "font-awesome": "4.2.0", - "FileSaver.js": "https://github.com/eligrey/FileSaver.js.git#24b303f49213b905ec9062b708f7cd43d56a5dde", - "zip.js": "https://github.com/gildas-lormeau/zip.js.git#bfd76c66293305faaf9fcbb65b5ff7fe2dbe621a", - "codemirror": "~5.2.0" - }, - "resolutions": { - "jquery": "1.10.2", - "jquery-ui": "1.11", - "ember": "1.7.0", - "bootstrap": "3.3.1", - "handlebars": "~1.3.0", - "jquery-mousewheel": "~3.1.12", - "antiscroll": "1.0.0", - "font-awesome": "4.2.0" + "ember": "2.2.0", + "ember-cli-shims": "0.0.6", + "ember-cli-test-loader": "0.2.1", + "ember-data": "2.1.0", + "ember-load-initializers": "0.1.7", + "ember-qunit": "0.4.16", + "ember-qunit-notifications": "0.1.0", + "loader.js": "3.3.0", + "qunit": "1.19.0", + "more-js": "0.8.2", + "bootstrap": "3.3.6", + "font-awesome": "4.5.0", + "jquery": "2.1.4", + "jquery-ui": "1.11.4", + "moment": "2.12.0", + "moment-timezone": "0.5.0", + "numeral": "1.5.3", + "snippet-ss": "1.11.0", + "jquery-mousewheel": "3.1.13", + "FileSaver": "https://github.com/eligrey/FileSaver.js.git#24b303f49213b905ec9062b708f7cd43d56a5dde", + "zip": "https://github.com/gildas-lormeau/zip.js.git#bfd76c66293305faaf9fcbb65b5ff7fe2dbe621a", + "codemirror": "5.11.0" } } http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/config/build-info.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/config/build-info.js b/tez-ui/src/main/webapp/config/build-info.js new file mode 100644 index 0000000..ae2b33d --- /dev/null +++ b/tez-ui/src/main/webapp/config/build-info.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +const POM_FILE = "../../../pom.xml"; +var fs = require('fs'); + +function fetchVersion() { + try { + var fileData = fs.readFileSync(POM_FILE, 'ascii'); + // Feel this is better than parsing the whole xml + return fileData.substring(fileData.indexOf("<version>") + 9, fileData.indexOf("</version>")); + }catch(e){} +} + +module.exports = { + version: fetchVersion() +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/config/configs.env ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/config/configs.env b/tez-ui/src/main/webapp/config/configs.env new file mode 100644 index 0000000..d1dc9f5 --- /dev/null +++ b/tez-ui/src/main/webapp/config/configs.env @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +ENV = { + hosts: { + /* + * Timeline Server Address: + * By default TEZ UI looks for timeline server at http://localhost:8188, uncomment and change + * the following value for pointing to a different address. + */ + //timeline: "http://localhost:8188", + + /* + * Resource Manager Address: + * By default RM REST APIs are expected to be at http://localhost:8088, uncomment and change + * the following value to point to a different address. + */ + //rm: "http://localhost:8088", + + /* + * Resource Manager Web Proxy Address: + * Optional - By default, value configured as RM host will be taken as proxy address + * Use this configuration when RM web proxy is configured at a different address than RM. + */ + //rmProxy: "http://localhost:8088", + }, + + /* + * Time Zone in which dates are displayed in the UI: + * If not set, local time zone will be used. + * Refer http://momentjs.com/timezone/docs/ for valid entries. + */ + //timeZone: "UTC", + + /* + * yarnProtocol: + * If specified, this protocol would be used to construct node manager log links. + * Possible values: http, https + * Default value: If not specified, protocol of hosts.rm will be used + */ + //yarnProtocol: "<value>", +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/config/default-app-conf.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/config/default-app-conf.js b/tez-ui/src/main/webapp/config/default-app-conf.js new file mode 100644 index 0000000..c53e4d7 --- /dev/null +++ b/tez-ui/src/main/webapp/config/default-app-conf.js @@ -0,0 +1,333 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +var buildInfo = require('./build-info'); + +module.exports = { // Tez App configurations + buildVersion: buildInfo.version || "", + isStandalone: true, // Must be set false while running in wrapped mode + rowLoadLimit: 9007199254740991, + pollingInterval: 3000, + + hosts: { + timeline: 'localhost:8188', + rm: 'localhost:8088', + }, + namespaces: { + webService: { + timeline: 'ws/v1/timeline', + appHistory: 'ws/v1/applicationhistory', + rm: 'ws/v1/cluster', + am: 'proxy/{app_id}/ws/v2/tez', + }, + web: { + rm: 'cluster' + }, + }, + paths: { + timeline: { + dag: 'TEZ_DAG_ID', + vertex: 'TEZ_VERTEX_ID', + task: 'TEZ_TASK_ID', + attempt: 'TEZ_TASK_ATTEMPT_ID', + + hiveQuery: 'HIVE_QUERY_ID', + + app: 'TEZ_APPLICATION' + }, + am: { + "dag-am": 'dagInfo', + "vertex-am": 'verticesInfo', + "task-am": 'tasksInfo', + "attempt-am": 'attemptsInfo', + }, + rm: { + "app-rm": "apps" + } + }, + hrefs: { + help: "https://tez.apache.org/tez_ui_user_data.html", + license: "http://www.apache.org/licenses/LICENSE-2.0" + }, + + tables: { + defaultColumns: { + counters: [ + // File System Counters + { + counterName: 'FILE_BYTES_READ', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'FILE_BYTES_WRITTEN', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'FILE_READ_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'FILE_LARGE_READ_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'FILE_WRITE_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'HDFS_BYTES_READ', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'HDFS_BYTES_WRITTEN', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'HDFS_READ_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'HDFS_LARGE_READ_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + { + counterName: 'HDFS_WRITE_OPS', + counterGroupName: 'org.apache.tez.common.counters.FileSystemCounter', + }, + + // Task Counters + { + counterName: "NUM_SPECULATIONS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "REDUCE_INPUT_GROUPS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "REDUCE_INPUT_RECORDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SPLIT_RAW_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "COMBINE_INPUT_RECORDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SPILLED_RECORDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "NUM_SHUFFLED_INPUTS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "NUM_SKIPPED_INPUTS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "NUM_FAILED_SHUFFLE_INPUTS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "MERGED_MAP_OUTPUTS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "GC_TIME_MILLIS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "CPU_MILLISECONDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "PHYSICAL_MEMORY_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "VIRTUAL_MEMORY_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "COMMITTED_HEAP_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "INPUT_RECORDS_PROCESSED", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "OUTPUT_RECORDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "OUTPUT_LARGE_RECORDS", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "OUTPUT_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "OUTPUT_BYTES_WITH_OVERHEAD", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "OUTPUT_BYTES_PHYSICAL", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "ADDITIONAL_SPILLS_BYTES_WRITTEN", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "ADDITIONAL_SPILLS_BYTES_READ", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "ADDITIONAL_SPILL_COUNT", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_BYTES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_BYTES_DECOMPRESSED", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_BYTES_TO_MEM", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_BYTES_TO_DISK", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_BYTES_DISK_DIRECT", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "NUM_MEM_TO_DISK_MERGES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "NUM_DISK_TO_DISK_MERGES", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "SHUFFLE_PHASE_TIME", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "MERGE_PHASE_TIME", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "FIRST_EVENT_RECEIVED", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + { + counterName: "LAST_EVENT_RECEIVED", + counterGroupName: "org.apache.tez.common.counters.TaskCounter", + }, + ], + + dagCounters: [ + { + counterName :"NUM_FAILED_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"NUM_KILLED_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"NUM_SUCCEEDED_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"TOTAL_LAUNCHED_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"OTHER_LOCAL_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"DATA_LOCAL_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"RACK_LOCAL_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"SLOTS_MILLIS_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"FALLOW_SLOTS_MILLIS_TASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"TOTAL_LAUNCHED_UBERTASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"NUM_UBER_SUBTASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + { + counterName :"NUM_FAILED_UBERTASKS", + counterGroupName :"org.apache.tez.common.counters.DAGCounter", + }, + + { + counterName: "REDUCE_OUTPUT_RECORDS", + counterGroupName: "REDUCE_OUTPUT_RECORDS", + }, + { + counterName: "REDUCE_SKIPPED_GROUPS", + counterGroupName: "REDUCE_SKIPPED_GROUPS", + }, + { + counterName: "REDUCE_SKIPPED_RECORDS", + counterGroupName: "REDUCE_SKIPPED_RECORDS", + }, + { + counterName: "COMBINE_OUTPUT_RECORDS", + counterGroupName: "COMBINE_OUTPUT_RECORDS", + }, + { + counterName: "SKIPPED_RECORDS", + counterGroupName: "SKIPPED_RECORDS", + }, + { + counterName: "INPUT_GROUPS", + counterGroupName: "INPUT_GROUPS", + } + ] + } + } +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/config/environment.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/config/environment.js b/tez-ui/src/main/webapp/config/environment.js new file mode 100644 index 0000000..0c755ac --- /dev/null +++ b/tez-ui/src/main/webapp/config/environment.js @@ -0,0 +1,70 @@ +/* jshint node: true */ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +const DEFAULT_APP_CONF = require('./default-app-conf'); + +module.exports = function(environment) { + var ENV = { + modulePrefix: 'tez-ui', + environment: environment, + locationType: 'hash', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true + } + }, + + APP: DEFAULT_APP_CONF, + + contentSecurityPolicy: { + 'connect-src': "* 'self'", + 'child-src': "'self' 'unsafe-inline'", + 'style-src': "'self' 'unsafe-inline'", + 'script-src': "'self' 'unsafe-inline'" + } + }; + + if (environment === 'development') { + // ENV.APP.LOG_RESOLVER = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.baseURL = '/'; + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.rootElement = '#ember-testing'; + } + + if (environment === 'production') { + + } + + return ENV; +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/ember-cli-build.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/ember-cli-build.js b/tez-ui/src/main/webapp/ember-cli-build.js new file mode 100644 index 0000000..d380982 --- /dev/null +++ b/tez-ui/src/main/webapp/ember-cli-build.js @@ -0,0 +1,76 @@ +/*jshint node:true*/ +/* global require, module */ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +var Funnel = require("broccoli-funnel"); +var EmberApp = require('ember-cli/lib/broccoli/ember-app'); +var MergeTrees = require('broccoli-merge-trees'); + +module.exports = function(defaults) { + var isProd = EmberApp.env() === 'production'; + var app = new EmberApp(defaults, { + storeConfigInMeta: false, + minifyCSS: { + enabled: isProd + }, + minifyJS: { + // Will be minified by wro4j-maven-plugin for performance + enabled: false, + }, + fingerprint: { + enabled: false + }, + sourcemaps: { + enabled: !isProd + } + }); + + var configEnv = new Funnel('config', { + srcDir: '/', + include: ['*.env'], + destDir: '/config' + }); + var zipWorker = new Funnel('bower_components/zip', { + srcDir: '/WebContent', + include: ['z-worker.js', 'deflate.js', 'inflate.js'], + destDir: '/assets/zip' + }); + var copyFonts = new Funnel('bower_components/font-awesome/', { + srcDir: '/fonts', + include: ['*.*'], + destDir: '/fonts' + }); + + app.import('bower_components/bootstrap/dist/js/bootstrap.js'); + app.import('bower_components/jquery-ui/jquery-ui.js'); + app.import('bower_components/jquery-ui/ui/tooltip.js'); + + app.import('bower_components/more-js/dist/more.js'); + + app.import('bower_components/FileSaver/FileSaver.js'); + app.import('bower_components/zip/WebContent/zip.js'); + + app.import('bower_components/codemirror/lib/codemirror.js'); + app.import('bower_components/codemirror/mode/sql/sql.js'); + app.import('bower_components/codemirror/mode/pig/pig.js'); + app.import('bower_components/codemirror/lib/codemirror.css'); + + return app.toTree(new MergeTrees([configEnv, zipWorker, copyFonts])); +}; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/package.json ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/package.json b/tez-ui/src/main/webapp/package.json index 33e7265..018c088 100644 --- a/tez-ui/src/main/webapp/package.json +++ b/tez-ui/src/main/webapp/package.json @@ -1,41 +1,63 @@ { "name": "tez-ui", - "version": "0.0.1", + "version": "0.2.0", + "license": "Apache-2.0", "description": "Apache Tez UI", - "repository" : { - "type" : "git", - "url" : "https://git-wip-us.apache.org/repos/asf/tez.git" + "private": true, + "directories": { + "doc": "doc", + "test": "tests" }, - "dependencies": {}, - "devDependencies": { - "bower": "1.3.12", - "grunt": "~0.4.1", - "grunt-cli": "~0.1.13", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-jshint": "~0.6.3", - "grunt-contrib-cssmin": "~0.6.0", - "grunt-contrib-connect": "~0.3.0", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-htmlmin": "~0.1.3", - "grunt-contrib-watch": "~0.5.2", - "grunt-rev": "~0.1.0", - "grunt-usemin": "~0.1.12", - "grunt-mocha": "~0.4.1", - "grunt-open": "~0.2.0", - "grunt-svgmin": "~0.2.0", - "grunt-concurrent": "~0.3.0", - "load-grunt-tasks": "~0.1.0", - "connect-livereload": "~0.2.0", - "grunt-ember-templates": "0.4.14", - "time-grunt": "~0.1.1", - "grunt-replace": "~0.4.4", - "jshint-stylish": "~0.1.3", - "grunt-neuter": "~0.6.0", - "grunt-contrib-less": "~0.11" + "scripts": { + "build": "TMPDIR=tmp node ./node_modules/ember-cli/bin/ember build", + "start": "TMPDIR=tmp node ./node_modules/ember-cli/bin/ember server", + "test": "TMPDIR=tmp node ./node_modules/ember-cli/bin/ember test", + + "build:mvn": "TMPDIR=tmp node/node ./node_modules/ember-cli/bin/ember build -prod", + "test:mvn": "TMPDIR=tmp node/node ./node_modules/ember-cli/bin/ember test" + }, + "repository": { + "type": "git", + "url": "https://git-wip-us.apache.org/repos/asf/tez.git" }, "engines": { - "node": ">=0.8.0" + "node": ">= 0.10.0" + }, + "devDependencies": { + "bower": "1.7.7", + "broccoli-asset-rev": "2.4.2", + "broccoli-funnel": "1.0.1", + "broccoli-merge-trees": "1.1.1", + "ember-bootstrap": "0.5.1", + "ember-cli": "1.13.13", + "ember-cli-app-version": "1.0.0", + "ember-cli-auto-register": "1.1.0", + "ember-cli-babel": "5.1.6", + "ember-cli-content-security-policy": "0.4.0", + "ember-cli-d3": "1.1.2", + "ember-cli-dependency-checker": "1.2.0", + "ember-cli-htmlbars": "1.0.2", + "ember-cli-htmlbars-inline-precompile": "0.3.1", + "ember-cli-inject-live-reload": "1.4.0", + "ember-cli-jquery-ui": "0.0.20", + "ember-cli-less": "1.5.3", + "ember-cli-moment-shim": "0.7.3", + "ember-cli-mousewheel": "0.1.5", + "ember-cli-numeral": "0.1.2", + "ember-cli-qunit": "1.2.1", + "ember-cli-release": "0.2.8", + "ember-cli-sri": "1.2.1", + "ember-cli-test-info": "1.0.0", + "ember-cli-uglify": "1.2.0", + "ember-data": "2.1.0", + "ember-disable-proxy-controllers": "1.0.1", + "ember-export-application-global": "1.0.5", + "ember-resolver": "2.0.3", + "phantomjs": "1.9.19" + }, + "dependencies": { + "em-helpers": "0.5.8", + "em-table": "0.3.12", + "em-tgraph": "0.0.4" } } http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/public/assets/images/favicon.png ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/public/assets/images/favicon.png b/tez-ui/src/main/webapp/public/assets/images/favicon.png new file mode 100644 index 0000000..4762bdf Binary files /dev/null and b/tez-ui/src/main/webapp/public/assets/images/favicon.png differ http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/public/assets/images/logo.png ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/public/assets/images/logo.png b/tez-ui/src/main/webapp/public/assets/images/logo.png new file mode 100644 index 0000000..f29455a Binary files /dev/null and b/tez-ui/src/main/webapp/public/assets/images/logo.png differ http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/testem.json ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/testem.json b/tez-ui/src/main/webapp/testem.json new file mode 100644 index 0000000..0f35392 --- /dev/null +++ b/tez-ui/src/main/webapp/testem.json @@ -0,0 +1,12 @@ +{ + "framework": "qunit", + "test_page": "tests/index.html?hidepassed", + "disable_watching": true, + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/.jshintrc ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/.jshintrc b/tez-ui/src/main/webapp/tests/.jshintrc new file mode 100644 index 0000000..6ec0b7c --- /dev/null +++ b/tez-ui/src/main/webapp/tests/.jshintrc @@ -0,0 +1,52 @@ +{ + "predef": [ + "document", + "window", + "location", + "setTimeout", + "$", + "-Promise", + "define", + "console", + "visit", + "exists", + "fillIn", + "click", + "keyEvent", + "triggerEvent", + "find", + "findWithAssert", + "wait", + "DS", + "andThen", + "currentURL", + "currentPath", + "currentRouteName" + ], + "node": false, + "browser": false, + "boss": true, + "curly": true, + "debug": false, + "devel": false, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true, + "unused": true +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/helpers/destroy-app.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/helpers/destroy-app.js b/tez-ui/src/main/webapp/tests/helpers/destroy-app.js new file mode 100644 index 0000000..dfabf85 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/helpers/destroy-app.js @@ -0,0 +1,23 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import Ember from 'ember'; + +export default function destroyApp(application) { + Ember.run(application, 'destroy'); +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/helpers/module-for-acceptance.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/helpers/module-for-acceptance.js b/tez-ui/src/main/webapp/tests/helpers/module-for-acceptance.js new file mode 100644 index 0000000..05aa014 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/helpers/module-for-acceptance.js @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { module } from 'qunit'; +import startApp from '../helpers/start-app'; +import destroyApp from '../helpers/destroy-app'; + +export default function(name, options = {}) { + module(name, { + beforeEach() { + this.application = startApp(); + + if (options.beforeEach) { + options.beforeEach.apply(this, arguments); + } + }, + + afterEach() { + destroyApp(this.application); + + if (options.afterEach) { + options.afterEach.apply(this, arguments); + } + } + }); +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/helpers/resolver.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/helpers/resolver.js b/tez-ui/src/main/webapp/tests/helpers/resolver.js new file mode 100644 index 0000000..9c3d98c --- /dev/null +++ b/tez-ui/src/main/webapp/tests/helpers/resolver.js @@ -0,0 +1,29 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import Resolver from 'ember/resolver'; +import config from '../../config/environment'; + +const resolver = Resolver.create(); + +resolver.namespace = { + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix +}; + +export default resolver; http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/helpers/start-app.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/helpers/start-app.js b/tez-ui/src/main/webapp/tests/helpers/start-app.js new file mode 100644 index 0000000..7b25773 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/helpers/start-app.js @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import Ember from 'ember'; +import Application from '../../app'; +import config from '../../config/environment'; + +export default function startApp(attrs) { + let application; + + let attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + + Ember.run(() => { + application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); + }); + + return application; +} http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/index.html ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/index.html b/tez-ui/src/main/webapp/tests/index.html new file mode 100644 index 0000000..6b43939 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/index.html @@ -0,0 +1,52 @@ +<!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* 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. +--> + +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <title>TezUi Tests</title> + <meta name="description" content=""> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + {{content-for 'head'}} + {{content-for 'test-head'}} + + <link rel="stylesheet" href="assets/vendor.css"> + <link rel="stylesheet" href="assets/tez-ui.css"> + <link rel="stylesheet" href="assets/test-support.css"> + + {{content-for 'head-footer'}} + {{content-for 'test-head-footer'}} + </head> + <body> + {{content-for 'body'}} + {{content-for 'test-body'}} + + <script src="assets/vendor.js"></script> + <script src="assets/test-support.js"></script> + <script src="assets/tez-ui.js"></script> + <script src="testem.js" integrity=""></script> + <script src="assets/tests.js"></script> + <script src="assets/test-loader.js"></script> + + {{content-for 'body-footer'}} + {{content-for 'test-body-footer'}} + </body> +</html> http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/caller-info-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/caller-info-test.js b/tez-ui/src/main/webapp/tests/integration/components/caller-info-test.js new file mode 100644 index 0000000..20f787c --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/caller-info-test.js @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('caller-info', 'Integration | Component | caller info', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testType = "Typ", + heading = "Additional Info from " + testType; + + this.set("type", testType); + + this.render(hbs`{{caller-info type=type}}`); + assert.equal(this.$(".panel-heading").text().trim(), heading); + + // Template block usage:" + EOL + + this.render(hbs` + {{#caller-info type=type}} + template block text + {{/caller-info}} + `); + assert.equal(this.$(".panel-heading").text().trim(), heading); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/column-selector-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/column-selector-test.js b/tez-ui/src/main/webapp/tests/integration/components/column-selector-test.js new file mode 100644 index 0000000..0034059 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/column-selector-test.js @@ -0,0 +1,87 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import Ember from 'ember'; + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('column-selector', 'Integration | Component | column selector', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.set("content", { + columns: [Ember.Object.create({ + headerTitle: "Test Column" + })] + }); + this.render(hbs`{{column-selector content=content}}`); + + assert.equal(this.$(".select-option ").text().trim(), 'Test Column'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#column-selector content=content}} + template block text + {{/column-selector}} + `); + + assert.equal(this.$(".select-option ").text().trim(), 'Test Column'); +}); + +test('visibleColumnIDs test', function(assert) { + + this.setProperties({ + content: { + visibleColumnIDs: { + testID: true, + }, + columns: [Ember.Object.create({ + id: "testID", + headerTitle: "Test Column" + })] + } + }); + + this.render(hbs`{{column-selector content=content}}`); + + assert.equal(this.$(".select-option").text().trim(), 'Test Column'); + assert.equal(this.$(".select-option input")[0].checked, true); +}); + +test('searchText test', function(assert) { + + this.setProperties({ + searchText: "nothing", + content: { + visibleColumnIDs: { + testID: true, + }, + columns: [Ember.Object.create({ + id: "testID", + headerTitle: "Test Column" + })] + } + }); + + this.render(hbs`{{column-selector content=content searchText=searchText}}`); + + assert.equal(this.$(".select-option").text().trim(), ''); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/dags-page-search-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/dags-page-search-test.js b/tez-ui/src/main/webapp/tests/integration/components/dags-page-search-test.js new file mode 100644 index 0000000..def7413 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/dags-page-search-test.js @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('dags-page-search', 'Integration | Component | dags page search', { + integration: true +}); + +test('Basic creation test', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + + + this.render(hbs`{{dags-page-search}}`); + + assert.equal(this.$("input").length, 5); + assert.equal(this.$("select").length, 1); + + // Template block usage:" + EOL + + this.render(hbs` + {{#dags-page-search}} + template block text + {{/dags-page-search}} + `); + + assert.equal(this.$("input").length, 5); + assert.equal(this.$("select").length, 1); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js b/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js new file mode 100644 index 0000000..e38a7be --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/dags-pagination-ui-test.js @@ -0,0 +1,130 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import wait from 'ember-test-helpers/wait'; + +moduleForComponent('dags-pagination-ui', 'Integration | Component | dags pagination ui', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("rowCountOptions", { + rowCountOptions: [1, 2] + }); + + this.render(hbs`{{dags-pagination-ui rowCountOptions=rowCountOptions}}`); + + assert.equal(this.$('select').length, 1); + + assert.equal(this.$('.page-list').length, 1); + assert.equal(this.$('li').length, 1); + + // Template block usage:" + EOL + + this.render(hbs` + {{#dags-pagination-ui rowCountOptions=rowCountOptions}} + template block text + {{/dags-pagination-ui}} + `); + + assert.equal(this.$('select').length, 1); +}); + +test('Page list test', function(assert) { + this.set("tableDefinition", { + pageNum: 5, + rowCount: 5, + + loadingMore: false, + moreAvailable: true, + + rowCountOptions: [] + }); + this.set("processor", { + totalPages: 10, + processedRows: { + length: 10 + } + }); + + this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition dataProcessor=processor}}`); + + return wait().then(() => { + assert.equal(this.$('li').length, 4); + assert.equal(this.$('li').eq(0).text().trim(), "First"); + assert.equal(this.$('li').eq(1).text().trim(), "4"); + assert.equal(this.$('li').eq(2).text().trim(), "5"); + assert.equal(this.$('li').eq(3).text().trim(), "6"); + }); +}); + +test('Page list - moreAvailable false test', function(assert) { + this.set("tableDefinition", { + pageNum: 5, + rowCount: 5, + + loadingMore: false, + moreAvailable: false, + + rowCountOptions: [] + }); + this.set("processor", { + totalPages: 5, + processedRows: { + length: 10 + } + }); + + this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition dataProcessor=processor}}`); + + return wait().then(() => { + assert.equal(this.$('li').length, 4); + assert.equal(this.$('li').eq(1).text().trim(), "3"); + assert.equal(this.$('li').eq(2).text().trim(), "4"); + assert.equal(this.$('li').eq(3).text().trim(), "5"); + }); +}); + +test('Page list - moreAvailable true test', function(assert) { + this.set("tableDefinition", { + pageNum: 5, + rowCount: 5, + + loadingMore: false, + moreAvailable: true, + + rowCountOptions: [] + }); + this.set("processor", { + totalPages: 5, + processedRows: { + length: 10 + } + }); + + this.render(hbs`{{dags-pagination-ui tableDefinition=tableDefinition dataProcessor=processor}}`); + + return wait().then(() => { + assert.equal(this.$('li').length, 4); + assert.equal(this.$('li').eq(1).text().trim(), "4"); + assert.equal(this.$('li').eq(2).text().trim(), "5"); + assert.equal(this.$('li').eq(3).text().trim(), "6"); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/date-formatter-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/date-formatter-test.js b/tez-ui/src/main/webapp/tests/integration/components/date-formatter-test.js new file mode 100644 index 0000000..dad41f9 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/date-formatter-test.js @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('date-formatter', 'Integration | Component | em table date-formatter cell', { + integration: true +}); + +test('Basic creation test', function(assert) { + + this.render(hbs`{{date-formatter}}`); + + assert.equal(this.$().text().trim(), 'Not Available!'); + + // Template block usage:" + EOL + + this.render(hbs` + {{#date-formatter}} + template block text + {{/date-formatter}} + `); + + assert.equal(this.$().text().trim(), 'Not Available!'); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-blocking-event-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-blocking-event-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-blocking-event-test.js new file mode 100644 index 0000000..1659ddc --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-blocking-event-test.js @@ -0,0 +1,117 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; +import wait from 'ember-test-helpers/wait'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-blocking-event', 'Integration | Component | em swimlane blocking event', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create()); + this.set("processor", Processor.create()); + + this.render(hbs`{{em-swimlane-blocking-event processor=processor process=process}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-blocking-event processor=processor process=process}} + template block text + {{/em-swimlane-blocking-event}} + `); + + assert.equal(this.$().text().trim(), ''); +}); + +test('Blocking test', function(assert) { + var blockingEventName = "blockingEvent", + processIndex = 5, + blockingIndex = 7, + processColor = "#123456"; + + this.set("process", Process.create({ + blockingEventName: blockingEventName, + index: processIndex, + getColor: function () { + return processColor; + }, + events: [{ + name: blockingEventName, + time: 2 + }] + })); + this.set("blocking", Process.create({ + index: blockingIndex, + endEvent: { + time: 5 + } + })); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-blocking-event processor=processor process=process blocking=blocking}}`); + + return wait().then(() => { + assert.equal(this.$(".em-swimlane-blocking-event").attr("style").trim(), 'left: 20%;'); + assert.equal(this.$(".event-line").css("height"), ((blockingIndex - processIndex) * 30) + "px"); + }); +}); + +test('Blocking test with blocking.endEvent.time < blockTime', function(assert) { + var blockingEventName = "blockingEvent", + processIndex = 5, + blockingIndex = 7, + processColor = "#123456"; + + this.set("process", Process.create({ + blockingEventName: blockingEventName, + index: processIndex, + getColor: function () { + return processColor; + }, + events: [{ + name: blockingEventName, + time: 5 + }] + })); + this.set("blocking", Process.create({ + index: blockingIndex, + endEvent: { + time: 2 + } + })); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-blocking-event processor=processor process=process blocking=blocking}}`); + + return wait().then(() => { + assert.equal(this.$(".em-swimlane-blocking-event").attr("style"), undefined); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-consolidated-process-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-consolidated-process-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-consolidated-process-test.js new file mode 100644 index 0000000..5fe79a5 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-consolidated-process-test.js @@ -0,0 +1,61 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; +import wait from 'ember-test-helpers/wait'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-consolidated-process', 'Integration | Component | em swimlane consolidated process', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.render(hbs`{{em-swimlane-consolidated-process}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-consolidated-process}} + template block text + {{/em-swimlane-consolidated-process}} + `); + + assert.equal(this.$().text().trim(), ''); +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create({ + consolidateStartTime: 3, + consolidateEndTime: 6 + })); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-consolidated-process process=process processor=processor}}`); + + return wait().then(() => { + assert.equal(this.$(".em-swimlane-consolidated-process").attr("style").trim(), + "left: 30%; right: 40%; z-index: 30;"); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-bar-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-bar-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-bar-test.js new file mode 100644 index 0000000..0e0eb1c --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-bar-test.js @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-event-bar', 'Integration | Component | em swimlane event bar', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create()); + this.set("processor", Processor.create()); + + this.render(hbs`{{em-swimlane-event-bar processor=processor process=process}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-event-bar process=process processor=processor}} + template block text + {{/em-swimlane-event-bar}} + `); + + assert.equal(this.$().text().trim(), ''); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-test.js new file mode 100644 index 0000000..cee0b3d --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-event-test.js @@ -0,0 +1,66 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +import wait from 'ember-test-helpers/wait'; + +moduleForComponent('em-swimlane-event', 'Integration | Component | em swimlane event', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create({})); + this.set("processor", Processor.create()); + + this.render(hbs`{{em-swimlane-event processor=processor process=process}}`); + + assert.ok(this.$(".event-bar")); + assert.ok(this.$(".event-window")); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-event process=process processor=processor}} + template block text + {{/em-swimlane-event}} + `); + + assert.ok(this.$(".event-bar")); + assert.ok(this.$(".event-window")); +}); + +test('Event position test', function(assert) { + this.set("process", Process.create()); + this.set("event", { + time: 6 + }); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-event processor=processor process=process event=event}}`); + + return wait().then(() => { + assert.equal(this.$(".em-swimlane-event").attr("style").trim(), "left: 60%;", "em-swimlane-event"); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-line-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-line-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-line-test.js new file mode 100644 index 0000000..5e933db --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-line-test.js @@ -0,0 +1,68 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import wait from 'ember-test-helpers/wait'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-process-line', 'Integration | Component | em swimlane process line', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create()); + this.set("processor", Processor.create()); + + this.render(hbs`{{em-swimlane-process-line process=process processor=processor}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-process-line process=process processor=processor}} + template block text + {{/em-swimlane-process-line}} + `); + + assert.equal(this.$().text().trim(), ''); +}); + +test('start-end event test', function(assert) { + this.set("process", Process.create({ + startEvent: { + time: 5 + }, + endEvent: { + time: 7 + } + })); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-process-line processor=processor process=process}}`); + + return wait().then(() => { + assert.equal(this.$(".process-line").eq(0).attr("style").trim(), "left: 50%; right: 30%;", "process-line"); + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-name-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-name-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-name-test.js new file mode 100644 index 0000000..8117529 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-name-test.js @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('em-swimlane-process-name', 'Integration | Component | em swimlane process name', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testName = "TestName"; + + this.set("process", { + name: testName + }); + + this.render(hbs`{{em-swimlane-process-name process=process}}`); + + assert.equal(this.$().text().trim(), testName); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-process-name process=process}} + template block text + {{/em-swimlane-process-name}} + `); + + assert.equal(this.$().text().trim(), testName); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/13132ec7/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-visual-test.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-visual-test.js b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-visual-test.js new file mode 100644 index 0000000..20bdba9 --- /dev/null +++ b/tez-ui/src/main/webapp/tests/integration/components/em-swimlane-process-visual-test.js @@ -0,0 +1,77 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +import wait from 'ember-test-helpers/wait'; + +import Process from 'tez-ui/utils/process'; +import Processor from 'tez-ui/utils/processor'; + +moduleForComponent('em-swimlane-process-visual', 'Integration | Component | em swimlane process visual', { + integration: true +}); + +test('Basic creation test', function(assert) { + this.set("process", Process.create()); + this.set("processor", Processor.create()); + + this.render(hbs`{{em-swimlane-process-visual process=process processor=processor}}`); + + assert.ok(this.$(".base-line")); + assert.ok(this.$(".event-window")); + + // Template block usage:" + EOL + + this.render(hbs` + {{#em-swimlane-process-visual processor=processor process=process}} + template block text + {{/em-swimlane-process-visual}} + `); + + assert.ok(this.$(".base-line")); + assert.ok(this.$(".event-window")); +}); + +test('Events test', function(assert) { + this.set("process", Process.create({ + events: [{ + name: "event1", + time: 5 + }, { + name: "event2", + time: 7 + }] + })); + this.set("processor", Processor.create({ + startTime: 0, + endTime: 10 + })); + + this.render(hbs`{{em-swimlane-process-visual processor=processor process=process startTime=0 timeWindow=10}}`); + + return wait().then(() => { + var events = this.$(".em-swimlane-event"); + + assert.equal(events.length, 2); + assert.equal(events.eq(0).attr("style").trim(), "left: 50%;", "em-swimlane-event 1 left"); + assert.equal(events.eq(1).attr("style").trim(), "left: 70%;", "em-swimlane-event 2 left"); + + assert.equal(this.$(".process-line").eq(0).attr("style").trim(), "left: 50%; right: 30%;", "process-line"); + }); +});
