Adding testdataloader method to remove all SO from the kibana index (#143400)

* Adding testdataloader method to remove all SO from the kibana index

* Changing call order per PR review feedback
This commit is contained in:
Kurt 2022-10-17 14:00:46 -04:00 committed by GitHub
parent 41d88e6677
commit 227288e726
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View file

@ -68,6 +68,7 @@ export function getTestDataLoader({ getService }) {
const kbnServer = getService('kibanaServer');
const supertest = getService('supertest');
const log = getService('log');
const es = getService('es');
return {
createFtrSpaces: async () => {
@ -124,5 +125,28 @@ export function getTestDataLoader({ getService }) {
])
);
},
deleteAllSavedObjectsFromKibanaIndex: async () => {
await es.deleteByQuery({
index: '.kibana',
wait_for_completion: true,
body: {
conflicts: 'proceed',
query: {
bool: {
must_not: [
{
term: {
type: {
value: 'space',
},
},
},
],
},
},
},
});
},
};
}

View file

@ -219,8 +219,8 @@ export function bulkCreateTestSuiteFactory(context: FtrProviderContext) {
});
after(async () => {
await testDataLoader.deleteAllSavedObjectsFromKibanaIndex();
await testDataLoader.deleteFtrSpaces();
await testDataLoader.deleteFtrSavedObjectsData();
});
const attrs = { attributes: { [NEW_ATTRIBUTE_KEY]: NEW_ATTRIBUTE_VAL } };

View file

@ -117,8 +117,8 @@ export function bulkGetTestSuiteFactory(context: FtrProviderContext) {
});
after(async () => {
await testDataLoader.deleteFtrSpaces();
await testDataLoader.deleteFtrSavedObjectsData();
await testDataLoader.deleteFtrSpaces();
});
for (const test of tests) {