Skip to content

Commit

Permalink
Changing order of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Nov 24, 2020
1 parent 24d8d00 commit 42305b4
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@
*/

import { FtrProviderContext } from '../../../common/ftr_provider_context';
import { setupSpacesAndUsers, tearDownUsers } from '..';

// eslint-disable-next-line import/no-default-export
export default function actionsTests({ loadTestFile, getService }: FtrProviderContext) {
describe('Actions', () => {
const securityService = getService('security');
const spacesService = getService('spaces');
const esArchiver = getService('esArchiver');

before(async () => {
await setupSpacesAndUsers(spacesService, securityService);
});

after(async () => {
await tearDownUsers(securityService);
await esArchiver.unload('empty_kibana');
});

loadTestFile(require.resolve('./builtin_action_types/email'));
loadTestFile(require.resolve('./builtin_action_types/es_index'));
loadTestFile(require.resolve('./builtin_action_types/es_index_preconfigured'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,56 @@
*/

import { FtrProviderContext } from '../../../common/ftr_provider_context';
import { setupSpacesAndUsers, tearDownUsers } from '..';

// eslint-disable-next-line import/no-default-export
export default function alertingTests({ loadTestFile }: FtrProviderContext) {
export default function alertingTests({ loadTestFile, getService }: FtrProviderContext) {
describe('Alerts', () => {
loadTestFile(require.resolve('./find'));
loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
loadTestFile(require.resolve('./disable'));
loadTestFile(require.resolve('./enable'));
loadTestFile(require.resolve('./execution_status'));
loadTestFile(require.resolve('./get'));
loadTestFile(require.resolve('./get_alert_state'));
loadTestFile(require.resolve('./get_alert_instance_summary'));
loadTestFile(require.resolve('./list_alert_types'));
loadTestFile(require.resolve('./mute_all'));
loadTestFile(require.resolve('./mute_instance'));
loadTestFile(require.resolve('./unmute_all'));
loadTestFile(require.resolve('./unmute_instance'));
loadTestFile(require.resolve('./update'));
loadTestFile(require.resolve('./update_api_key'));
loadTestFile(require.resolve('./alerts'));
loadTestFile(require.resolve('./event_log'));

// note that this test will destroy existing spaces
loadTestFile(require.resolve('./rbac_legacy'));
const securityService = getService('security');
const spacesService = getService('spaces');
const esArchiver = getService('esArchiver');

describe('legacy alerts', () => {
before(async () => {
await setupSpacesAndUsers(spacesService, securityService);
});

after(async () => {
await tearDownUsers(securityService);
await esArchiver.unload('empty_kibana');
});

loadTestFile(require.resolve('./rbac_legacy'));
});

describe('alerts', () => {
before(async () => {
await setupSpacesAndUsers(spacesService, securityService);
});

after(async () => {
await tearDownUsers(securityService);
await esArchiver.unload('empty_kibana');
});

loadTestFile(require.resolve('./find'));
loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
loadTestFile(require.resolve('./disable'));
loadTestFile(require.resolve('./enable'));
loadTestFile(require.resolve('./execution_status'));
loadTestFile(require.resolve('./get'));
loadTestFile(require.resolve('./get_alert_state'));
loadTestFile(require.resolve('./get_alert_instance_summary'));
loadTestFile(require.resolve('./list_alert_types'));
loadTestFile(require.resolve('./mute_all'));
loadTestFile(require.resolve('./mute_instance'));
loadTestFile(require.resolve('./unmute_all'));
loadTestFile(require.resolve('./unmute_instance'));
loadTestFile(require.resolve('./update'));
loadTestFile(require.resolve('./update_api_key'));
loadTestFile(require.resolve('./alerts'));
loadTestFile(require.resolve('./event_log'));
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,9 @@ export default function alertingApiIntegrationTests({
loadTestFile,
getService,
}: FtrProviderContext) {
const securityService = getService('security');
const spacesService = getService('spaces');
const esArchiver = getService('esArchiver');

describe('alerting api integration security and spaces enabled', function () {
this.tags('ciGroup5');

before(async () => {
await setupSpacesAndUsers(spacesService, securityService);
});

after(async () => {
await tearDownUsers(securityService);

await esArchiver.unload('empty_kibana');
});

loadTestFile(require.resolve('./actions'));
loadTestFile(require.resolve('./alerting'));
});
Expand Down

0 comments on commit 42305b4

Please sign in to comment.