Skip to content

Commit bd8892c

Browse files
ezimueldelvedor
authored andcommitted
Improved cleanup yaml tests (#1306)
1 parent 360fe7b commit bd8892c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

test/integration/test-runner.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,15 @@ function build (opts = {}) {
5454
}
5555

5656
try {
57-
const { body: templates } = await client.indices.getTemplate()
58-
await helper.runInParallel(
59-
client, 'indices.deleteTemplate',
60-
Object.keys(templates).map(t => ({ name: t }))
61-
)
57+
await client.indices.deleteTemplate({ name: '*' })
6258
} catch (err) {
6359
assert.ifError(err, 'should not error: indices.deleteTemplate')
6460
}
6561

6662
try {
6763
const { body: repositories } = await client.snapshot.getRepository()
6864
for (const repository of Object.keys(repositories)) {
69-
const { body: snapshots } = await client.snapshot.get({ repository, snapshot: '_all' })
70-
await helper.runInParallel(
71-
client, 'snapshot.delete',
72-
Object.keys(snapshots).map(snapshot => ({ snapshot, repository })),
73-
{ ignore: [404] }
74-
)
65+
await client.snapshot.delete({ repository, snapshot: '*' }, { ignore: [404] })
7566
await client.snapshot.deleteRepository({ repository }, { ignore: [404] })
7667
}
7768
} catch (err) {

0 commit comments

Comments
 (0)