Updated cleanup code
This commit is contained in:
@ -84,16 +84,8 @@ class TestRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { body: repositories } = await this.client.snapshot.getRepository()
|
await this.client.snapshot.delete({ repository: '*', snapshot: '*' }, { ignore: 404 })
|
||||||
for (const repository of Object.keys(repositories)) {
|
await this.client.snapshot.deleteRepository({ repository: '*' }, { ignore: 404 })
|
||||||
const { body: snapshots } = await this.client.snapshot.get({ repository, snapshot: '_all' })
|
|
||||||
await helper.runInParallel(
|
|
||||||
this.client, 'snapshot.delete',
|
|
||||||
Object.keys(snapshots).map(snapshot => ({ snapshot, repository })),
|
|
||||||
{ ignore: [404] }
|
|
||||||
)
|
|
||||||
await this.client.snapshot.deleteRepository({ repository }, { ignore: [404] })
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.tap.error(err, 'should not error: snapshot.delete / snapshot.deleteRepository')
|
this.tap.error(err, 'should not error: snapshot.delete / snapshot.deleteRepository')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user