Skip to content

Commit

Permalink
fix merge conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuellr committed Sep 29, 2020
1 parent 5edacca commit 95fcc5a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
*/

import { FtrProviderContext } from '../../../common/ftr_provider_context';
import { buildUp, tearDown } from '..';

// eslint-disable-next-line import/no-default-export
export default function alertingTests({ loadTestFile }: FtrProviderContext) {
describe('Alerts', () => {
export default function alertingTests({ loadTestFile, getService }: FtrProviderContext) {
describe('Alerting', () => {
before(async () => buildUp(getService));
after(async () => tearDown(getService));

loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
loadTestFile(require.resolve('./disable'));
Expand Down
42 changes: 16 additions & 26 deletions x-pack/test/alerting_api_integration/spaces_only/tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,26 @@ import { FtrProviderContext } from '../../common/ftr_provider_context';
import { Spaces } from '../scenarios';

// eslint-disable-next-line import/no-default-export
export default function alertingApiIntegrationTests({
loadTestFile,
getService,
}: FtrProviderContext) {
const spacesService = getService('spaces');
const esArchiver = getService('esArchiver');

export default function alertingApiIntegrationTests({ loadTestFile }: FtrProviderContext) {
describe('alerting api integration spaces only', function () {
this.tags('ciGroup9');

before(async () => {
for (const space of Object.values(Spaces)) {
if (space.id === 'default') continue;

const { id, name, disabledFeatures } = space;

try {
await spacesService.delete(id);
} catch (err) {
// try deleting before creating, in case it already exists,
// but obviously it's ok if it fails (because it doesn't yet exist)
}

await spacesService.create({ id, name, disabledFeatures });
}
});

after(async () => await esArchiver.unload('empty_kibana'));

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

export async function buildUp(getService: FtrProviderContext['getService']) {
const spacesService = getService('spaces');
for (const space of Object.values(Spaces)) {
if (space.id === 'default') continue;

const { id, name, disabledFeatures } = space;
await spacesService.create({ id, name, disabledFeatures });
}
}

export async function tearDown(getService: FtrProviderContext['getService']) {
const esArchiver = getService('esArchiver');
await esArchiver.unload('empty_kibana');
}

0 comments on commit 95fcc5a

Please sign in to comment.