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:
diff --git a/src/js/components/AppDebugInfoComponent.jsx b/src/js/components/AppDebugInfoComponent.jsx
index 7ce19f4bd..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) {
@@ -62,6 +63,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,8 +89,11 @@ var AppDebugInfoComponent = React.createClass({
{version} ({new Moment(version).fromNow()})
- Mesos Details
-
+ Mesos details
+
+
+
+
);
},
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);
}
diff --git a/src/test/units/AppDebugInfoComponent.test.js b/src/test/units/AppDebugInfoComponent.test.js
index 341b133e7..7c3ebf27c 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").at(0).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);
});