From cf1cdbcf5eb9c0356cd7273a4278160ec2a9f3f5 Mon Sep 17 00:00:00 2001 From: Tomasz Mosiej Date: Tue, 10 May 2016 16:21:46 +0200 Subject: [PATCH 1/4] #3447 fix link --- src/js/components/AppDebugInfoComponent.jsx | 4 +- src/test/units/AppDebugInfoComponent.test.js | 48 +++++++++++--------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/js/components/AppDebugInfoComponent.jsx b/src/js/components/AppDebugInfoComponent.jsx index 7ce19f4bd..a56ef0288 100644 --- a/src/js/components/AppDebugInfoComponent.jsx +++ b/src/js/components/AppDebugInfoComponent.jsx @@ -62,6 +62,8 @@ var AppDebugInfoComponent = React.createClass({ ); } + lastTaskFailure.id = lastTaskFailure.id || lastTaskFailure.taskId; + const timestamp = lastTaskFailure.timestamp; const timeStampText = new Date(timestamp) > new Date() ? "Just now" @@ -86,7 +88,7 @@ var AppDebugInfoComponent = React.createClass({
{version} ({new Moment(version).fromNow()})
-
Mesos Details
+
Mesos details
); diff --git a/src/test/units/AppDebugInfoComponent.test.js b/src/test/units/AppDebugInfoComponent.test.js index 341b133e7..8a4c5bbb4 100644 --- a/src/test/units/AppDebugInfoComponent.test.js +++ b/src/test/units/AppDebugInfoComponent.test.js @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {shallow} from "enzyme"; +import {shallow, mount} from "enzyme"; import nock from "nock"; import config from "../../js/config/config"; @@ -20,18 +20,18 @@ import expectAsync from "./../helpers/expectAsync"; describe("App debug info component", function () { describe("Last task failure", function () { + var info = { + "version": "1.2.3", + "frameworkId": "framework1", + "leader": "leader1.dcos.io", + "marathon_config": { + "marathon_field_1": "mf1", + "mesos_master_url": "http://master.dcos.io:5050", + "mesos_leader_ui_url" : "http://leader1.dcos.io:5050" + } + }; before(function (done) { - var info = { - "version": "1.2.3", - "frameworkId": "framework1", - "leader": "leader1.dcos.io", - "marathon_config": { - "marathon_field_1": "mf1", - "mesos_master_url": "http://leader1.dcos.io:5050" - } - }; - nock(config.apiURL) .get("/v2/info") .reply(200, info); @@ -45,17 +45,20 @@ describe("App debug info component", function () { }); it("should show failed task", function (done) { + var task = { + appId: "/python", + host: "slave1.dcos.io", + message: "Slave slave1.dcos.io removed", + state: "TASK_LOST", + taskId: "python.83c0a69b-256a-11e5-aaed-fa163eaaa6b7", + slaveId: "slaveABC", + timestamp: "2015-08-05T09:08:56.349Z", + version: "2015-07-06T12:37:28.774Z" + }; + var app = Util.extendObject(appScheme, { id: "/python", - lastTaskFailure: { - appId: "/python", - host: "slave1.dcos.io", - message: "Slave slave1.dcos.io removed", - state: "TASK_LOST", - taskId: "python.83c0a69b-256a-11e5-aaed-fa163eaaa6b7", - timestamp: "2015-08-05T09:08:56.349Z", - version: "2015-07-06T12:37:28.774Z" - } + lastTaskFailure: task }); nock(config.apiURL) @@ -67,7 +70,7 @@ describe("App debug info component", function () { AppsStore.once(AppsEvents.CHANGE, () => { expectAsync(() => { - this.component = shallow(); + this.component = mount(); var nodes = this.component.find("dd"); var taskId = nodes.at(0).text().trim(); @@ -76,6 +79,7 @@ describe("App debug info component", function () { var host = nodes.at(3).text().trim(); var timestamp = nodes.at(4).find("span").text().trim(); var version = nodes.at(5).find("span").text().trim(); + var details = nodes.at(6).find("a").props().href; expect(taskId) .to.equal("python.83c0a69b-256a-11e5-aaed-fa163eaaa6b7"); @@ -84,6 +88,8 @@ describe("App debug info component", function () { expect(host).to.equal("slave1.dcos.io"); expect(timestamp).to.equal("2015-08-05T09:08:56.349Z"); expect(version).to.equal("2015-07-06T12:37:28.774Z"); + expect(details).to.equal(info.marathon_config.mesos_leader_ui_url + "/#/slaves/" + + task.slaveId + "/frameworks/framework1/executors/" + task.taskId); }, done); }); From 5d43f37d135c1521cfea4c4882ac4b0f02393c86 Mon Sep 17 00:00:00 2001 From: Tomasz Mosiej Date: Thu, 19 May 2016 15:34:44 +0200 Subject: [PATCH 2/4] #3447 fix travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8c6a69f97..def0607f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js before_install: - - npm install -g npm - npm cache clear - npm install -g gulp node_js: From 3b4007b62a9d143123f2a626a93865360a4d1f70 Mon Sep 17 00:00:00 2001 From: Tomasz Mosiej Date: Wed, 25 May 2016 09:58:13 +0200 Subject: [PATCH 3/4] sysout and syserr on debug --- src/js/components/AppDebugInfoComponent.jsx | 6 +++++- src/test/units/AppDebugInfoComponent.test.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/components/AppDebugInfoComponent.jsx b/src/js/components/AppDebugInfoComponent.jsx index a56ef0288..95cc2ee6a 100644 --- a/src/js/components/AppDebugInfoComponent.jsx +++ b/src/js/components/AppDebugInfoComponent.jsx @@ -6,6 +6,7 @@ import AppsActions from "../actions/AppsActions"; import AppsEvents from "../events/AppsEvents"; import AppTaskStatsListComponent from "../components/AppTaskStatsListComponent"; import TaskMesosUrlComponent from "../components/TaskMesosUrlComponent"; +import TaskFileDownloadComponent from "../components/TaskFileDownloadComponent"; import UnspecifiedNodeComponent from "../components/UnspecifiedNodeComponent"; function invalidateValue(value, suffix) { @@ -89,7 +90,10 @@ var AppDebugInfoComponent = React.createClass({ {version} ({new Moment(version).fromNow()})
Mesos details
-
+
+ + +
); }, diff --git a/src/test/units/AppDebugInfoComponent.test.js b/src/test/units/AppDebugInfoComponent.test.js index 8a4c5bbb4..7c3ebf27c 100644 --- a/src/test/units/AppDebugInfoComponent.test.js +++ b/src/test/units/AppDebugInfoComponent.test.js @@ -79,7 +79,7 @@ describe("App debug info component", function () { var host = nodes.at(3).text().trim(); var timestamp = nodes.at(4).find("span").text().trim(); var version = nodes.at(5).find("span").text().trim(); - var details = nodes.at(6).find("a").props().href; + var details = nodes.at(6).find("a").at(0).props().href; expect(taskId) .to.equal("python.83c0a69b-256a-11e5-aaed-fa163eaaa6b7"); From 7f24971a0b37d93460e4fecf7822ad790cb465a5 Mon Sep 17 00:00:00 2001 From: Tomasz Mosiej Date: Wed, 25 May 2016 12:12:38 +0200 Subject: [PATCH 4/4] sysout and syserr on debug + search executors in completed_executors --- src/js/stores/MesosStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/stores/MesosStore.js b/src/js/stores/MesosStore.js index c4710d479..1966cabe7 100644 --- a/src/js/stores/MesosStore.js +++ b/src/js/stores/MesosStore.js @@ -150,7 +150,9 @@ function getExecutorDirectoryFromState(frameworkId, taskId, state) { if (framework.executors != null) { executor = framework.executors.find(matchExecutor); - } else if (framework.completed_executors != null) { + } + + if (framework.completed_executors != null && executor == null) { executor = framework.completed_executors.find(matchExecutor); }