Show the progress deadline for task groups in a running deployment

This commit is contained in:
Michael Lange 2018-06-06 17:35:18 -07:00
parent 37a8fb2af2
commit 73881a388c
4 changed files with 42 additions and 1 deletions

View file

@ -22,4 +22,6 @@ export default Fragment.extend({
placedAllocs: attr('number'),
healthyAllocs: attr('number'),
unhealthyAllocs: attr('number'),
requireProgressBy: attr('date'),
});

View file

@ -15,6 +15,9 @@
<th>Allocs</th>
<th>Healthy Allocs</th>
<th>Unhealthy Allocs</th>
{{#if inProgress}}
<th>Progress Deadline</th>
{{/if}}
{{/t.head}}
{{#t.body as |row|}}
<tr data-test-deployment-task-group>
@ -31,6 +34,11 @@
<td data-test-deployment-task-group-allocs>{{row.model.placedAllocs}} / {{row.model.desiredTotal}}</td>
<td data-test-deployment-task-group-healthy>{{row.model.healthyAllocs}}</td>
<td data-test-deployment-task-group-unhealthy>{{row.model.unhealthyAllocs}}</td>
{{#if inProgress}}
<td data-test-deployment-task-group-progress-deadline>
<span class="nowrap">{{moment-format row.model.requireProgressBy "MM/DD/YY HH:mm:ss"}}</span>
</td>
{{/if}}
</tr>
{{/t.body}}
{{/list-table}}

View file

@ -19,7 +19,7 @@
{{#job-deployment-details deployment=job.runningDeployment as |d|}}
{{d.metrics}}
{{#if isShowingDeploymentDetails}}
{{d.taskGroups}}
{{d.taskGroups inProgress=true}}
{{d.allocations}}
{{/if}}
{{/job-deployment-details}}

View file

@ -139,3 +139,34 @@ test('the active deployment section can be expanded to show task groups and allo
});
});
});
test('each task group in the expanded task group section shows task group details', function(assert) {
this.server.create('node');
this.server.create('job', { type: 'service', activeDeployment: true });
this.store.findAll('job');
return wait().then(() => {
const job = this.store.peekAll('job').get('firstObject');
this.set('job', job);
this.render(hbs`
{{job-page/parts/running-deployment job=job}}
`);
return wait()
.then(() => {
click('[data-test-deployment-toggle-details]');
return wait();
})
.then(() => {
const task = job.get('runningDeployment.taskGroupSummaries.firstObject');
const findForTaskGroup = selector => find(`[data-test-deployment-task-group-${selector}]`);
assert.equal(findForTaskGroup('name').textContent.trim(), task.get('name'));
assert.equal(
findForTaskGroup('progress-deadline').textContent.trim(),
moment(task.get('requireProgressBy')).format('MM/DD/YY HH:mm:ss')
);
});
});
});