From 00c180787fc570ec61035cd17ec3b507719e9b46 Mon Sep 17 00:00:00 2001 From: Tyler Smalley Date: Thu, 17 Jun 2021 13:47:00 -0700 Subject: [PATCH] [FTR] Stabilize SSLP functional tests (#102553) * Removes spaces check, since spaces should always be available * Disables Monitoring, SecuritySolutions, and Reporting in SSPL tests until #102552 is completed Signed-off-by: Tyler Smalley --- .../kbn-es-archiver/src/actions/empty_kibana_index.ts | 3 +-- packages/kbn-es-archiver/src/actions/unload.ts | 3 +-- .../src/lib/indices/delete_index_stream.test.ts | 4 ++-- .../src/lib/indices/delete_index_stream.ts | 9 ++------- .../kbn-es-archiver/src/lib/indices/kibana_index.ts | 10 ---------- test/functional/config.js | 7 ++++++- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/packages/kbn-es-archiver/src/actions/empty_kibana_index.ts b/packages/kbn-es-archiver/src/actions/empty_kibana_index.ts index dbc455bbd2f8f..24a1de10b2b1d 100644 --- a/packages/kbn-es-archiver/src/actions/empty_kibana_index.ts +++ b/packages/kbn-es-archiver/src/actions/empty_kibana_index.ts @@ -22,9 +22,8 @@ export async function emptyKibanaIndexAction({ kbnClient: KbnClient; }) { const stats = createStats('emptyKibanaIndex', log); - const kibanaPluginIds = await kbnClient.plugins.getEnabledIds(); - await cleanKibanaIndices({ client, stats, log, kibanaPluginIds }); + await cleanKibanaIndices({ client, stats, log }); await migrateKibanaIndex(kbnClient); stats.createdIndex('.kibana'); return stats.toJSON(); diff --git a/packages/kbn-es-archiver/src/actions/unload.ts b/packages/kbn-es-archiver/src/actions/unload.ts index d8bc013b40991..98bae36095b88 100644 --- a/packages/kbn-es-archiver/src/actions/unload.ts +++ b/packages/kbn-es-archiver/src/actions/unload.ts @@ -37,7 +37,6 @@ export async function unloadAction({ }) { const name = relative(REPO_ROOT, inputDir); const stats = createStats(name, log); - const kibanaPluginIds = await kbnClient.plugins.getEnabledIds(); const files = prioritizeMappings(await readDirectory(inputDir)); for (const filename of files) { @@ -47,7 +46,7 @@ export async function unloadAction({ createReadStream(resolve(inputDir, filename)) as Readable, ...createParseArchiveStreams({ gzip: isGzip(filename) }), createFilterRecordsStream('index'), - createDeleteIndexStream(client, stats, log, kibanaPluginIds), + createDeleteIndexStream(client, stats, log), ] as [Readable, ...Writable[]]); } diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts index 3198ba86207f0..241d4a8944546 100644 --- a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts +++ b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.test.ts @@ -28,7 +28,7 @@ describe('esArchiver: createDeleteIndexStream()', () => { await createPromiseFromStreams([ createListStream([createStubIndexRecord('index1')]), - createDeleteIndexStream(client, stats, log, []), + createDeleteIndexStream(client, stats, log), ]); sinon.assert.notCalled(stats.deletedIndex as sinon.SinonSpy); @@ -43,7 +43,7 @@ describe('esArchiver: createDeleteIndexStream()', () => { await createPromiseFromStreams([ createListStream([createStubIndexRecord('index1')]), - createDeleteIndexStream(client, stats, log, []), + createDeleteIndexStream(client, stats, log), ]); sinon.assert.calledOnce(stats.deletedIndex as sinon.SinonSpy); diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts index e1552b5ed1e3b..7765419bb9d15 100644 --- a/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts +++ b/packages/kbn-es-archiver/src/lib/indices/delete_index_stream.ts @@ -14,12 +14,7 @@ import { Stats } from '../stats'; import { deleteIndex } from './delete_index'; import { cleanKibanaIndices } from './kibana_index'; -export function createDeleteIndexStream( - client: KibanaClient, - stats: Stats, - log: ToolingLog, - kibanaPluginIds: string[] -) { +export function createDeleteIndexStream(client: KibanaClient, stats: Stats, log: ToolingLog) { return new Transform({ readableObjectMode: true, writableObjectMode: true, @@ -29,7 +24,7 @@ export function createDeleteIndexStream( const { index } = record.value; if (index.startsWith('.kibana')) { - await cleanKibanaIndices({ client, stats, log, kibanaPluginIds }); + await cleanKibanaIndices({ client, stats, log }); } else { await deleteIndex({ client, stats, log, index }); } diff --git a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts index 0712d2789a91a..635e432468846 100644 --- a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts +++ b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts @@ -96,21 +96,11 @@ export async function cleanKibanaIndices({ client, stats, log, - kibanaPluginIds, }: { client: KibanaClient; stats: Stats; log: ToolingLog; - kibanaPluginIds: string[]; }) { - if (!kibanaPluginIds.includes('spaces')) { - return await deleteKibanaIndices({ - client, - stats, - log, - }); - } - while (true) { const resp = await client.deleteByQuery( { diff --git a/test/functional/config.js b/test/functional/config.js index eac21e5a45618..bab1148cf372a 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -42,9 +42,14 @@ export default async function ({ readConfigFile }) { serverArgs: [ ...commonConfig.get('kbnTestServer.serverArgs'), '--telemetry.optIn=false', - '--xpack.security.enabled=false', '--savedObjects.maxImportPayloadBytes=10485760', '--xpack.maps.showMapVisualizationTypes=true', + + // to be re-enabled once kibana/issues/102552 is completed + '--xpack.security.enabled=false', + '--monitoring.enabled=false', + '--xpack.reporting.enabled=false', + '--enterpriseSearch.enabled=false', ], },