Skip to content

Commit

Permalink
[7.x] cleanup es even if test fails (elastic#47868) (elastic#47906)
Browse files Browse the repository at this point in the history
* cleanup es even if test fails

* use correct beforeAll/afterAll hooks for jest
  • Loading branch information
Spencer authored Oct 10, 2019
1 parent 3d9fb52 commit d2bcbb7
Showing 1 changed file with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,29 @@ describe(`running the plugin-generator via 'node scripts/generate_plugin.js plug
await execa('yarn', ['build'], { cwd: generatedPath });
});

it(`'yarn start' should result in the spec plugin being initialized on kibana's stdout`, async () => {
describe('with es instance', () => {
const log = new ToolingLog();

const es = createLegacyEsTestCluster({ license: 'basic', log });
await es.start();
await withProcRunner(log, async proc => {
await proc.run('kibana', {
cmd: 'yarn',
args: [
'start',
'--optimize.enabled=false',
'--logging.json=false',
'--migrations.skip=true',
],
cwd: generatedPath,
wait: /ispec_plugin.+Status changed from uninitialized to green - Ready/,
beforeAll(es.start);
afterAll(es.stop);

it(`'yarn start' should result in the spec plugin being initialized on kibana's stdout`, async () => {
await withProcRunner(log, async proc => {
await proc.run('kibana', {
cmd: 'yarn',
args: [
'start',
'--optimize.enabled=false',
'--logging.json=false',
'--migrations.skip=true',
],
cwd: generatedPath,
wait: /ispec_plugin.+Status changed from uninitialized to green - Ready/,
});
await proc.stop('kibana');
});
await proc.stop('kibana');
});
await es.stop();
});

it(`'yarn preinstall' should exit 0`, async () => {
Expand Down

0 comments on commit d2bcbb7

Please sign in to comment.