From cf6350b0aebc1deba7f873f02b3bf32911cf3153 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Wed, 15 Feb 2017 21:34:22 +0530 Subject: [PATCH] node-label --- .../src/main/webapp/app/adapters/yarn-nodelabel.js | 33 ++++++++ .../webapp/app/controllers/yarn-nodes/label.js | 90 ++++++++++++++++++++++ .../src/main/webapp/app/models/yarn-nodelabel.js | 27 +++++++ .../hadoop-yarn-ui/src/main/webapp/app/router.js | 1 + .../src/main/webapp/app/routes/cluster-overview.js | 1 - .../src/main/webapp/app/routes/yarn-nodes.js | 3 + .../src/main/webapp/app/routes/yarn-nodes/label.js | 22 ++++++ .../main/webapp/app/serializers/yarn-nodelabel.js | 65 ++++++++++++++++ .../src/main/webapp/app/templates/application.hbs | 4 +- .../src/main/webapp/app/templates/yarn-nodes.hbs | 6 +- .../main/webapp/app/templates/yarn-nodes/label.hbs | 89 +++++++++++++++++++++ .../src/main/webapp/config/configs.env | 4 +- .../tests/unit/adapters/yarn-nodelabel-test.js | 12 +++ .../unit/controllers/yarn-nodes/label-test.js | 12 +++ .../tests/unit/models/yarn-nodelabel-test.js | 12 +++ .../tests/unit/routes/yarn-nodes/label-test.js | 11 +++ .../tests/unit/serializers/yarn-nodelabel-test.js | 15 ++++ 17 files changed, 401 insertions(+), 6 deletions(-) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js new file mode 100644 index 0000000..ecf6192 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-nodelabel.js @@ -0,0 +1,33 @@ +/** + * 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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + + address: "rmWebAddress", + restNameSpace: "cluster", + serverName: "RM", + + urlForFindAll() { + var url = this._buildURL(); + url = url + "/label-mappings"; + return url; + }, + +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js new file mode 100644 index 0000000..9a257a8 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/label.js @@ -0,0 +1,90 @@ +/** + * 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 Ember.Controller.extend({ + nodeLabels: Ember.computed('model.nodes', 'model.nodeLabels', function() { + var nodes = this.get('model.nodes'); + var nodeLabels = this.get('model.nodeLabels'); + var nodeCount = 0; + nodeLabels.forEach((label) => { + nodeCount += label.get('nodesCount'); + }); + var defaultNodeList = this.getDefaultPartitionNodesList(nodes); + var defaultLabel = this.store.createRecord('yarn-nodelabel', { + id: 'default_partition_' + Date.now(), +        labelName: "DEFAULT_PARTITION", +        nodesList: defaultNodeList, + nodesCount: nodes.get('length') - nodeCount +      }); + this.setLabelResources(defaultLabel); + nodeLabels.forEach((label) => { + this.setLabelResources(label); + }); + return nodeLabels; + }), + + getDefaultPartitionNodesList(nodes) { + var list = []; + nodes.forEach(function(node) { + if(!node.get('nodeLabels')) { + list.push(node.get('id')); + } + }); + return list; + }, + + setLabelResources(label) { + var totMem = 0; + var totVCore = 0; + label.get('nodesList').forEach((nodeId) => { + let node = this.store.peekRecord('yarn-rm-node', nodeId); + if(node) { + totMem += node.get('usedMemoryMB') + node.get('availMemoryMB'); + totVCore += node.get('usedVirtualCores') + node.get('availableVirtualCores'); + } + }); + label.set('totalMemory', totMem); + label.set('totalVCores', totVCore); + }, + + getMemoryDataForDonutChart: Ember.computed('nodeLabels', function() { + var nodeLabels = this.store.peekAll('yarn-nodelabel'); + var chartData = []; + nodeLabels.forEach(function(nodelabel) { + chartData.push({ + label: nodelabel.get('labelName'), + value: nodelabel.get('totalMemory') + }); + }); + return chartData; + }), + + getVCoreDataForDonutChart: Ember.computed('nodeLabels', function() { + var nodeLabels = this.store.peekAll('yarn-nodelabel'); + var chartData = []; + nodeLabels.forEach(function(nodelabel) { + chartData.push({ + label: nodelabel.get('labelName'), + value: nodelabel.get('totalVCores') + }); + }); + return chartData; + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js new file mode 100644 index 0000000..7af6547 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-nodelabel.js @@ -0,0 +1,27 @@ +/** + * 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 DS from 'ember-data'; + +export default DS.Model.extend({ + labelName: DS.attr('string'), + nodesList: DS.attr(), + nodesCount: DS.attr('number'), + totalMemory: DS.attr('number'), + totalVCores: DS.attr('number'), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js index 87a018d..0e77493 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js @@ -31,6 +31,7 @@ Router.map(function() { this.route('yarn-nodes', function(){ this.route('table'); this.route('heatmap'); + this.route('label'); }); this.route('yarn-nodes-heatmap'); this.route('yarn-node', { path: '/yarn-node/:node_id/:node_addr' }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js index 6cb4dc8..1068126 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/cluster-overview.js @@ -22,7 +22,6 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model() { - //this.store.unloadAll('yarn-app'); return Ember.RSVP.hash({ clusterMetrics: this.store.findAll('ClusterMetric'), apps: this.store.query('yarn-app', diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js index 4439569..74cde01 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes.js @@ -22,14 +22,17 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model() { + this.store.unloadAll('yarn-nodelabel'); return Ember.RSVP.hash({ nodes: this.store.findAll('yarn-rm-node'), clusterMetrics: this.store.findAll('ClusterMetric'), + nodeLabels: this.store.findAll('yarn-nodelabel') }); }, unloadAll() { this.store.unloadAll('yarn-rm-node'); this.store.unloadAll('ClusterMetric'); + this.store.unloadAll('yarn-nodelabel'); } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.js new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-nodes/label.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 Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js new file mode 100644 index 0000000..3f1c55a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-nodelabel.js @@ -0,0 +1,65 @@ +/** + * 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 DS from 'ember-data'; + +export default DS.JSONAPISerializer.extend({ + internalNormalizeSingleResponse(store, primaryModelClass, payload) { + if (payload.entry) { + payload = payload.entry; + } + var actualNodeList = payload.value.nodeIDsList.filter(function(nodeName) { + return nodeName.split(':')[1] !== "0"; + }); + var fixedPayload = { + id: payload.key + "_" + Date.now(), + type: primaryModelClass.modelName, // yarn-app + attributes: { + labelName: payload.key, + nodesList: actualNodeList, + nodesCount: actualNodeList.length + } + }; + + return fixedPayload; + }, + + normalizeSingleResponse(store, primaryModelClass, payload, id/*, requestType*/) { + var p = this.internalNormalizeSingleResponse(store, + primaryModelClass, payload); + return { data: p }; + }, + + normalizeArrayResponse(store, primaryModelClass, payload/*, id, requestType*/) { + // return expected is { data: [ {}, {} ] } + var normalizedArrayResponse = {}; + + // payload has labelsToNodes : { entry: [ {},{},{} ] } + // need some error handling for ex apps or app may not be defined. + if(payload.labelsToNodes && payload.labelsToNodes.entry) { + normalizedArrayResponse.data = payload.labelsToNodes.entry.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, + singleApp); + }, this); + } else { + normalizedArrayResponse.data = []; + } + + return normalizedArrayResponse; + } +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs index 4a2ba38..af615ca 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs @@ -51,8 +51,8 @@ (current) {{/link-to}} {{/link-to}} - {{#link-to 'yarn-nodes.table' tagName="li" currentWhen="yarn-nodes.table yarn-nodes.heatmap"}} - {{#link-to 'yarn-nodes.table' class="navigation-link" currentWhen="yarn-nodes.table yarn-nodes.heatmap"}}Nodes + {{#link-to 'yarn-nodes.table' tagName="li" currentWhen="yarn-nodes.table yarn-nodes.heatmap yarn-nodes.label"}} + {{#link-to 'yarn-nodes.table' class="navigation-link" currentWhen="yarn-nodes.table yarn-nodes.heatmap yarn-nodes.label"}}Nodes (current) {{/link-to}} {{/link-to}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs index 874b3c4..ce12169 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs @@ -33,11 +33,15 @@ {{/link-to}} {{/link-to}} + {{#link-to 'yarn-nodes.label' tagName="li"}} + {{#link-to 'yarn-nodes.label'}}Node Labels + {{/link-to}} + {{/link-to}} + {{#link-to 'yarn-nodes.heatmap' tagName="li"}} {{#link-to 'yarn-nodes.heatmap'}}Nodes Heatmap Chart {{/link-to}} {{/link-to}} - diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs new file mode 100644 index 0000000..0745c05 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/label.hbs @@ -0,0 +1,89 @@ +{{!-- + 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. +--}} +
+ {{#if nodeLabels}} + + + + + + + + + + + {{#each nodeLabels as |label|}} + + + + + + + {{/each}} + +
Node LabelExclusivityNode CountResource
{{label.labelName}}Exclusive{{label.nodesCount}}Memory: {{label.totalMemory}}, VCores: {{label.totalVCores}}
+ + {{simple-table table-id="labels-table" bFilter=true}} + {{else}} +

No labels found on this cluster

+ {{/if}} +
+ + +
+
+
+
+ NodeLabel - Memory +
+
+ {{donut-chart data=getMemoryDataForDonutChart + showLabels=true + parentId="label-mem-donut-chart" + ratio=0.6 + maxHeight=350 + colorTargets="good" + colorTargetReverse=true + type="memory" + }} +
+
+
+ +
+
+
+ NodeLabel - VCores +
+
+ {{donut-chart data=getVCoreDataForDonutChart + showLabels=true + parentId="label-vcore-donut-chart" + ratio=0.6 + maxHeight=350 + colorTargets="good" + colorTargetReverse=true + }} +
+
+
+ +
+ +{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/configs.env b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/configs.env index 04577c9..8fab724 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/configs.env +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/configs.env @@ -31,14 +31,14 @@ ENV = { * By default timeline server is set as localhost:8188, uncomment and change * the following value for pointing to a different address. */ - //timelineWebAddress: "localhost:8188", + timelineWebAddress: "localhost:8188", /* * RM web interface can be configured below. * By default RM web address is set as localhost:8088, uncomment and change * the following value for pointing to a different address. */ - //rmWebAddress: "localhost:8088", + rmWebAddress: "172.27.0.101:8088", /* * Protocol scheme. It can be "http:" or "https:". By default, http is used. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js new file mode 100644 index 0000000..3d66a7e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/adapters/yarn-nodelabel-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:yarn-nodelabel', 'Unit | Adapter | yarn nodelabel', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let adapter = this.subject(); + assert.ok(adapter); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js new file mode 100644 index 0000000..5d2c05c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/label-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:yarn-nodes/label', 'Unit | Controller | yarn nodes/label', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js new file mode 100644 index 0000000..048200c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/models/yarn-nodelabel-test.js @@ -0,0 +1,12 @@ +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-nodelabel', 'Unit | Model | yarn nodelabel', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + let model = this.subject(); + // let store = this.store(); + assert.ok(!!model); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js new file mode 100644 index 0000000..e1ae17a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/routes/yarn-nodes/label-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:yarn-nodes/label', 'Unit | Route | yarn nodes/label', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js new file mode 100644 index 0000000..fe9b5f4 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/serializers/yarn-nodelabel-test.js @@ -0,0 +1,15 @@ +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('yarn-nodelabel', 'Unit | Serializer | yarn nodelabel', { + // Specify the other units that are required for this test. + needs: ['serializer:yarn-nodelabel'] +}); + +// Replace this with your real tests. +test('it serializes records', function(assert) { + let record = this.subject(); + + let serializedRecord = record.serialize(); + + assert.ok(serializedRecord); +}); -- 2.10.1 (Apple Git-78)