[JENKINS-38009] in running mode we do not want to expand the failure node (#532)
This commit is contained in:
parent
83f71acb95
commit
5564709a0c
|
@ -28,6 +28,10 @@ export const getNodesInformation = (nodes) => {
|
|||
let wasFocused = false; // we only want one node to be focused if any
|
||||
let parallelNodes = [];
|
||||
let parent;
|
||||
// FIXME: this assumaption is not 100% correct since a job that is in queue would be marked as finished since
|
||||
// there will be no running nodes yet!
|
||||
const finished = runningNodes.length === 0;
|
||||
const error = !(errorNodes.length === 0);
|
||||
const model = nodes.map((item, index) => {
|
||||
const hasFailingNode = item.edges ? item.edges
|
||||
.filter((itemError) => errorNodes.indexOf(itemError.id) > -1).length > 0 : false;
|
||||
|
@ -76,18 +80,13 @@ export const getNodesInformation = (nodes) => {
|
|||
modelItem.estimatedDurationInMillis = item.estimatedDurationInMillis;
|
||||
modelItem.isMultiBranch = true;
|
||||
}
|
||||
if ((isRunningNode || (isFailingNode && !hasFailingNode)) && !wasFocused) {
|
||||
if ((isRunningNode || (isFailingNode && !hasFailingNode && finished)) && !wasFocused) {
|
||||
wasFocused = true;
|
||||
modelItem.isFocused = true;
|
||||
}
|
||||
return modelItem;
|
||||
});
|
||||
|
||||
// FIXME: this assumaption is not 100% correct since a job that is in queue would be marked as finished since
|
||||
// there will be no running nodes yet!
|
||||
const finished = runningNodes.length === 0;
|
||||
const error = !(errorNodes.length === 0);
|
||||
|
||||
// creating the response object
|
||||
const information = {
|
||||
isFinished: finished,
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
export default [
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/5/"
|
||||
},
|
||||
"actions": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/5/actions/"
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/5/log/"
|
||||
}
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.support.actions.LogActionImpl",
|
||||
"urlName": "log"
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": null
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.actions.TimingAction",
|
||||
"urlName": null
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": null
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.actions.ErrorAction",
|
||||
"urlName": null
|
||||
}
|
||||
],
|
||||
"displayName": "Shell Script",
|
||||
"durationInMillis": 280,
|
||||
"id": "5",
|
||||
"result": "FAILURE",
|
||||
"startTime": "2016-09-27T16:03:50.439+0200",
|
||||
"state": "FINISHED"
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/6/"
|
||||
},
|
||||
"actions": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/6/actions/"
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/6/log/"
|
||||
}
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.support.actions.LogActionImpl",
|
||||
"urlName": "log"
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": null
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.actions.TimingAction",
|
||||
"urlName": null
|
||||
}
|
||||
],
|
||||
"displayName": "Shell Script",
|
||||
"durationInMillis": 277,
|
||||
"id": "6",
|
||||
"result": "SUCCESS",
|
||||
"startTime": "2016-09-27T16:03:50.719+0200",
|
||||
"state": "FINISHED"
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/7/"
|
||||
},
|
||||
"actions": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/7/actions/"
|
||||
}
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": {
|
||||
"_class": "io.jenkins.blueocean.rest.hal.Link",
|
||||
"href": "/blue/rest/organizations/jenkins/pipelines/JENKINS-38014-BadStyle/runs/3/steps/7/log/"
|
||||
}
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.support.actions.LogActionImpl",
|
||||
"urlName": "log"
|
||||
},
|
||||
{
|
||||
"_class": "io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl",
|
||||
"_links": {
|
||||
"self": null
|
||||
},
|
||||
"_class": "org.jenkinsci.plugins.workflow.actions.TimingAction",
|
||||
"urlName": null
|
||||
}
|
||||
],
|
||||
"displayName": "Shell Script",
|
||||
"durationInMillis": 48959,
|
||||
"id": "7",
|
||||
"result": "UNKNOWN",
|
||||
"startTime": "2016-09-27T16:03:50.996+0200",
|
||||
"state": "RUNNING"
|
||||
}
|
||||
]
|
|
@ -19,6 +19,7 @@ import { firstRunning } from './runNodes-firstRunning';
|
|||
import { finishedMultipleFailure } from './runNodes-finishedMultipleFailure';
|
||||
import { queuedAborted } from './runNodes-QueuedAborted';
|
||||
import { getNodesInformation } from './../../main/js/util/logDisplayHelper';
|
||||
import runningFailing from './data/steps/failingRunningSteps';
|
||||
|
||||
|
||||
import Step from '../../main/js/components/Step';
|
||||
|
@ -35,6 +36,10 @@ const assertResult = (item, {finished = true, failed = false, errors = 0, runnin
|
|||
};
|
||||
|
||||
describe("Logic test of different runs", () => {
|
||||
it('running and failing', () => {
|
||||
const stagesInformationRunningFailing = getNodesInformation(runningFailing);
|
||||
console.log(stagesInformationRunningFailing.model[2].isFocused, true);
|
||||
});
|
||||
it("handles aborted job that only had been in queue but never build", () => {
|
||||
const stagesInformationQueuedAborted = getNodesInformation(queuedAborted);
|
||||
assert.equal(stagesInformationQueuedAborted.hasResultsForSteps, false);
|
||||
|
|
Loading…
Reference in New Issue