Skip to content

Commit

Permalink
[FTR] Stabilize SSLP functional tests
Browse files Browse the repository at this point in the history
* Removes spaces check, since spaces should always be available
* Disables Monitoring, SecuritySolutions, and Reporting in SSPL tests
until elastic#102552 is completed

Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley committed Jun 17, 2021
1 parent e3454ea commit b82d43d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 24 deletions.
3 changes: 1 addition & 2 deletions packages/kbn-es-archiver/src/actions/empty_kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-es-archiver/src/actions/unload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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[]]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 });
}
Expand Down
10 changes: 0 additions & 10 deletions packages/kbn-es-archiver/src/lib/indices/kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down
7 changes: 6 additions & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
},

Expand Down

0 comments on commit b82d43d

Please sign in to comment.