Skip to content

Commit

Permalink
Remove vaultError, failedSibling and messagePassthru
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cowen authored and schmichael committed Feb 14, 2018
1 parent 28197b1 commit 7996807
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.
2 changes: 0 additions & 2 deletions ui/app/models/task-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ export default Fragment.extend({
taskSignal: attr('string'),
taskSignalReason: attr('string'),
validationError: attr('string'),
vaultError: attr('string'),
message: attr('string'),
failedSibling: attr('string'),
});
4 changes: 0 additions & 4 deletions ui/mirage/factories/allocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export default Factory.extend({
clientStatus: faker.list.random(...CLIENT_STATUSES),
desiredStatus: faker.list.random(...DESIRED_STATUSES),

// Meta property for hinting at task events
useMessagePassthru: false,

withTaskWithPorts: trait({
afterCreate(allocation, server) {
const taskGroup = server.db.taskGroups.findBy({ name: allocation.taskGroup });
Expand Down Expand Up @@ -79,7 +76,6 @@ export default Factory.extend({
server.create('task-state', {
allocation,
name: server.db.tasks.find(id).name,
useMessagePassthru: allocation.useMessagePassthru,
})
);

Expand Down
7 changes: 0 additions & 7 deletions ui/mirage/factories/task-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ const STATES = provide(10, faker.system.fileExt.bind(faker.system));
export default Factory.extend({
type: faker.list.random(...STATES),

// Message is a function of type, and this type uses the vanilla
// message property.
messagePassthru: trait({
type: 'Task Setup',
}),

signal: () => '',
exitCode: () => null,
time: () => faker.date.past(2 / 365, REF_TIME) * 1000000,
Expand All @@ -26,6 +20,5 @@ export default Factory.extend({
setupError: () => '',
taskSignalReason: () => '',
validationError: () => '',
vaultError: () => '',
message: () => faker.lorem.sentence(),
});
4 changes: 1 addition & 3 deletions ui/mirage/factories/task-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ export default Factory.extend({
return new Date(this.startedAt + Math.random(1000 * 60 * 3) + 50);
},

useMessagePassthru: false,

afterCreate(state, server) {
const props = [
'task-event',
faker.random.number({ min: 1, max: 10 }),
state.useMessagePassthru && 'messagePassthru',
false,
{
taskStateId: state.id,
},
Expand Down
12 changes: 3 additions & 9 deletions ui/tests/acceptance/allocation-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ moduleForAcceptance('Acceptance | allocation detail', {

node = server.create('node');
job = server.create('job', { groupCount: 0 });
allocation = server.create('allocation', 'withTaskWithPorts', {
useMessagePassthru: true,
});
allocation = server.create('allocation', 'withTaskWithPorts');

visit(`/allocations/${allocation.id}`);
},
});

test('/allocation/:id should name the allocation and link to the corresponding job and node', function(
assert
) {
test('/allocation/:id should name the allocation and link to the corresponding job and node', function(assert) {
assert.ok(
find('[data-test-title]').textContent.includes(allocation.name),
'Allocation name is in the heading'
Expand Down Expand Up @@ -125,9 +121,7 @@ test('each task row should list high-level information for the task', function(a
});
});

test('when the allocation is not found, an error message is shown, but the URL persists', function(
assert
) {
test('when the allocation is not found, an error message is shown, but the URL persists', function(assert) {
visit('/allocations/not-a-real-allocation');

andThen(() => {
Expand Down
12 changes: 3 additions & 9 deletions ui/tests/acceptance/task-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ moduleForAcceptance('Acceptance | task detail', {
server.create('agent');
server.create('node');
server.create('job', { createAllocations: false });
allocation = server.create('allocation', 'withTaskWithPorts', {
useMessagePassthru: true,
});
allocation = server.create('allocation', 'withTaskWithPorts');
task = server.db.taskStates.where({ allocationId: allocation.id })[0];

visit(`/allocations/${allocation.id}/${task.name}`);
},
});

test('/allocation/:id/:task_name should name the task and list high-level task information', function(
assert
) {
test('/allocation/:id/:task_name should name the task and list high-level task information', function(assert) {
assert.ok(find('[data-test-title]').textContent.includes(task.name), 'Task name');
assert.ok(find('[data-test-state]').textContent.includes(task.state), 'Task state');

Expand Down Expand Up @@ -119,9 +115,7 @@ test('the events table lists all recent events', function(assert) {
);
});

test('each recent event should list the time, type, and description of the event', function(
assert
) {
test('each recent event should list the time, type, and description of the event', function(assert) {
const event = server.db.taskEvents.where({ taskStateId: task.id })[0];
const recentEvent = findAll('[data-test-task-event]').get('lastObject');

Expand Down

0 comments on commit 7996807

Please sign in to comment.