Speed up slow acceptance tests with shallow jobs and generally less models
This commit is contained in:
parent
6988dc1b5c
commit
9358713560
|
@ -13,6 +13,7 @@ const makeSearchAllocations = server => {
|
|||
.map((_, index) => {
|
||||
server.create('allocation', {
|
||||
id: index < 5 ? `ffffff-dddddd-${index}` : `111111-222222-${index}`,
|
||||
shallow: true,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -28,7 +29,7 @@ module('Acceptance | job allocations', function(hooks) {
|
|||
});
|
||||
|
||||
test('lists all allocations for the job', async function(assert) {
|
||||
server.createList('allocation', Allocations.pageSize - 1);
|
||||
server.createList('allocation', Allocations.pageSize - 1, { shallow: true });
|
||||
allocations = server.schema.allocations.where({ jobId: job.id }).models;
|
||||
|
||||
await Allocations.visit({ id: job.id });
|
||||
|
|
|
@ -8,26 +8,26 @@ import JobDetail from 'nomad-ui/tests/pages/jobs/detail';
|
|||
import JobsList from 'nomad-ui/tests/pages/jobs/list';
|
||||
|
||||
moduleForJob('Acceptance | job detail (batch)', 'allocations', () =>
|
||||
server.create('job', { type: 'batch' })
|
||||
server.create('job', { type: 'batch', shallow: true })
|
||||
);
|
||||
moduleForJob('Acceptance | job detail (system)', 'allocations', () =>
|
||||
server.create('job', { type: 'system' })
|
||||
server.create('job', { type: 'system', shallow: true })
|
||||
);
|
||||
moduleForJob('Acceptance | job detail (periodic)', 'children', () =>
|
||||
server.create('job', 'periodic')
|
||||
server.create('job', 'periodic', { shallow: true })
|
||||
);
|
||||
|
||||
moduleForJob('Acceptance | job detail (parameterized)', 'children', () =>
|
||||
server.create('job', 'parameterized')
|
||||
server.create('job', 'parameterized', { shallow: true })
|
||||
);
|
||||
|
||||
moduleForJob('Acceptance | job detail (periodic child)', 'allocations', () => {
|
||||
const parent = server.create('job', 'periodic');
|
||||
const parent = server.create('job', 'periodic', { childrenCount: 1, shallow: true });
|
||||
return server.db.jobs.where({ parentId: parent.id })[0];
|
||||
});
|
||||
|
||||
moduleForJob('Acceptance | job detail (parameterized child)', 'allocations', () => {
|
||||
const parent = server.create('job', 'parameterized');
|
||||
const parent = server.create('job', 'parameterized', { childrenCount: 1, shallow: true });
|
||||
return server.db.jobs.where({ parentId: parent.id })[0];
|
||||
});
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ module('Acceptance | namespaces (disabled)', function(hooks) {
|
|||
hooks.beforeEach(function() {
|
||||
server.create('agent');
|
||||
server.create('node');
|
||||
server.createList('job', 5);
|
||||
server.createList('job', 5, { createAllocations: false });
|
||||
});
|
||||
|
||||
test('the namespace switcher is not in the gutter menu', async function(assert) {
|
||||
|
|
|
@ -15,7 +15,7 @@ module('Acceptance | regions (only one)', function(hooks) {
|
|||
hooks.beforeEach(function() {
|
||||
server.create('agent');
|
||||
server.create('node');
|
||||
server.createList('job', 5);
|
||||
server.createList('job', 2, { createAllocations: false, noDeployments: true });
|
||||
});
|
||||
|
||||
test('when there is only one region, the region switcher is not shown in the nav bar', async function(assert) {
|
||||
|
@ -68,7 +68,8 @@ module('Acceptance | regions (many)', function(hooks) {
|
|||
hooks.beforeEach(function() {
|
||||
server.create('agent');
|
||||
server.create('node');
|
||||
server.createList('job', 5);
|
||||
server.createList('job', 2, { createAllocations: false, noDeployments: true });
|
||||
server.create('allocation');
|
||||
server.create('region', { id: 'global' });
|
||||
server.create('region', { id: 'region-2' });
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue