Skip to content

Commit

Permalink
Test for denominatored batch job change
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed May 10, 2023
1 parent 02b951b commit 53fc47f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions ui/app/components/job-status/panel/steady.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export default class JobStatusPanelSteadyComponent extends Component {
get totalAllocs() {
if (this.args.job.type === 'service' || this.args.job.type === 'batch') {
return this.args.job.taskGroups.reduce((sum, tg) => sum + tg.count, 0);
// } else if (this.args.job.type === 'batch') {
// return this.args.job.taskGroups.reduce((sum, tg) => sum + tg.count, 0) - this.completedAllocs.length;
} else if (this.atMostOneAllocPerNode) {
return this.args.job.allocations.uniqBy('nodeID').length;
} else {
Expand Down
11 changes: 8 additions & 3 deletions ui/tests/acceptance/job-status-panel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ module('Acceptance | job status panel', function (hooks) {
groupTaskCount: 10,
noActiveDeployment: true,
shallow: true,
version: 0,
version: 1,
});

let serviceJob = server.create('job', {
Expand All @@ -745,13 +745,18 @@ module('Acceptance | job status panel', function (hooks) {
groupTaskCount: 10,
noActiveDeployment: true,
shallow: true,
version: 0,
version: 1,
});

// Batch job should have 5 running, 3 failed, 2 completed
await visit(`/jobs/${batchJob.id}`);
assert.dom('.job-status-panel').exists();
assert.dom('.running-allocs-title').hasText('5/10 Allocations Running');
assert
.dom('.running-allocs-title')
.hasText(
'5/8 Remaining Allocations Running',
'Completed allocations do not count toward the Remaining denominator'
);
assert
.dom('.ungrouped-allocs .represented-allocation.complete')
.exists(
Expand Down

0 comments on commit 53fc47f

Please sign in to comment.