From 596a76148ea189d8741324be8dc78bd4dcb501af Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Mon, 14 Sep 2020 11:16:17 +0200 Subject: [PATCH 1/2] Improved cleanup yaml tests --- test/integration/test-runner.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/integration/test-runner.js b/test/integration/test-runner.js index 959473a24..611df1b87 100644 --- a/test/integration/test-runner.js +++ b/test/integration/test-runner.js @@ -75,11 +75,7 @@ function build (opts = {}) { } try { - const { body: templates } = await client.indices.getTemplate() - await helper.runInParallel( - client, 'indices.deleteTemplate', - Object.keys(templates).map(t => ({ name: t })) - ) + await client.indices.deleteTemplate({ name: '*'}) } catch (err) { assert.ifError(err, 'should not error: indices.deleteTemplate') } @@ -87,12 +83,7 @@ function build (opts = {}) { try { const { body: repositories } = await client.snapshot.getRepository() for (const repository of Object.keys(repositories)) { - const { body: snapshots } = await client.snapshot.get({ repository, snapshot: '_all' }) - await helper.runInParallel( - client, 'snapshot.delete', - Object.keys(snapshots).map(snapshot => ({ snapshot, repository })), - { ignore: [404] } - ) + await client.snapshot.delete({ repository, snapshot: '*'}, { ignore: [404] }) await client.snapshot.deleteRepository({ repository }, { ignore: [404] }) } } catch (err) { From fc6240baee2e92cb9abf8c417ba4e2f83799bcac Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Mon, 14 Sep 2020 11:44:02 +0200 Subject: [PATCH 2/2] Fixed lint issues --- test/integration/test-runner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/test-runner.js b/test/integration/test-runner.js index 611df1b87..d73683c7b 100644 --- a/test/integration/test-runner.js +++ b/test/integration/test-runner.js @@ -75,7 +75,7 @@ function build (opts = {}) { } try { - await client.indices.deleteTemplate({ name: '*'}) + await client.indices.deleteTemplate({ name: '*' }) } catch (err) { assert.ifError(err, 'should not error: indices.deleteTemplate') } @@ -83,7 +83,7 @@ function build (opts = {}) { try { const { body: repositories } = await client.snapshot.getRepository() for (const repository of Object.keys(repositories)) { - await client.snapshot.delete({ repository, snapshot: '*'}, { ignore: [404] }) + await client.snapshot.delete({ repository, snapshot: '*' }, { ignore: [404] }) await client.snapshot.deleteRepository({ repository }, { ignore: [404] }) } } catch (err) {