From cdaa3d3851514f646e23a7485302d096237b2803 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Fri, 22 Sep 2023 17:13:38 +0200 Subject: [PATCH] [ML] Transforms: Enable SLO transforms installer on CI (#165470) ## Summary This enables the installer for SLO transforms on CI. - For the `many_fields_transform` performance journey, it will then look for the "Create transform" on top of the table instead of the "Create your first transform" button. Command to test the performance journey: `node scripts/run_performance.js --journey-path x-pack/performance/journeys/many_fields_transform.ts --skip-warmup` - For the functional tests that assert the empty transform list, this adds a command to delete all transforms before running those tests. --- x-pack/performance/journeys/many_fields_transform.ts | 4 ++-- .../observability/server/services/slo/slo_installer.ts | 2 +- x-pack/plugins/transform/public/app/hooks/use_index_data.ts | 2 ++ .../apps/transform/permissions/full_transform_access.ts | 4 ++++ .../apps/transform/permissions/read_transform_access.ts | 4 ++++ .../functional/apps/upgrade_assistant/deprecation_pages.ts | 4 ++-- x-pack/test/functional/config.upgrade_assistant.ts | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/x-pack/performance/journeys/many_fields_transform.ts b/x-pack/performance/journeys/many_fields_transform.ts index 6fe945914c358..14187c20e5c59 100644 --- a/x-pack/performance/journeys/many_fields_transform.ts +++ b/x-pack/performance/journeys/many_fields_transform.ts @@ -15,11 +15,11 @@ export const journey = new Journey({ .step('Go to Transforms', async ({ page, kbnUrl, kibanaPage }) => { await page.goto(kbnUrl.get(`app/management/data/transform`)); await kibanaPage.waitForHeader(); - await page.waitForSelector(subj('transformCreateFirstButton')); + await page.waitForSelector(subj('transformButtonCreate')); await page.waitForSelector(subj('globalLoadingIndicator-hidden')); }) .step('Go to data view selection', async ({ page }) => { - const createButtons = page.locator(subj('transformCreateFirstButton')); + const createButtons = page.locator(subj('transformButtonCreate')); await createButtons.first().click(); await page.waitForSelector(subj('savedObjectsFinderTable')); }) diff --git a/x-pack/plugins/observability/server/services/slo/slo_installer.ts b/x-pack/plugins/observability/server/services/slo/slo_installer.ts index 44c2a7752e315..bdee31f62912d 100644 --- a/x-pack/plugins/observability/server/services/slo/slo_installer.ts +++ b/x-pack/plugins/observability/server/services/slo/slo_installer.ts @@ -22,7 +22,7 @@ export class DefaultSLOInstaller implements SLOInstaller { ) {} public async install() { - if (this.isInstalling || process.env.CI) { + if (this.isInstalling) { return; } this.isInstalling = true; diff --git a/x-pack/plugins/transform/public/app/hooks/use_index_data.ts b/x-pack/plugins/transform/public/app/hooks/use_index_data.ts index 4534552f6b405..471146f583dc8 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_index_data.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_index_data.ts @@ -310,6 +310,8 @@ export const useIndexData = ( if ( dataGrid.status === INDEX_STATUS.LOADED && dataViewFields !== undefined && + Array.isArray(histogramsForFieldsData) && + histogramsForFieldsData.length > 0 && loadIndexDataStartTime.current !== undefined ) { const loadIndexDataDuration = window.performance.now() - loadIndexDataStartTime.current; diff --git a/x-pack/test/functional/apps/transform/permissions/full_transform_access.ts b/x-pack/test/functional/apps/transform/permissions/full_transform_access.ts index 4969832b3600e..2e7779767eaca 100644 --- a/x-pack/test/functional/apps/transform/permissions/full_transform_access.ts +++ b/x-pack/test/functional/apps/transform/permissions/full_transform_access.ts @@ -17,6 +17,10 @@ export default function ({ getService }: FtrProviderContext) { describe('with no data loaded', function () { before(async () => { await transform.securityUI.loginAsTransformPowerUser(); + + // For this test to work, make sure there are no pre-existing transform present. + // For example, solutions might set up transforms automatically. + await transform.api.cleanTransformIndices(); }); after(async () => { diff --git a/x-pack/test/functional/apps/transform/permissions/read_transform_access.ts b/x-pack/test/functional/apps/transform/permissions/read_transform_access.ts index 918cd5c144a84..4e715d4f07467 100644 --- a/x-pack/test/functional/apps/transform/permissions/read_transform_access.ts +++ b/x-pack/test/functional/apps/transform/permissions/read_transform_access.ts @@ -17,6 +17,10 @@ export default function ({ getService }: FtrProviderContext) { describe('with no data loaded', function () { before(async () => { await transform.securityUI.loginAsTransformViewer(); + + // For this test to work, make sure there are no pre-existing transform present. + // For example, solutions might set up transforms automatically. + await transform.api.cleanTransformIndices(); }); after(async () => { diff --git a/x-pack/test/functional/apps/upgrade_assistant/deprecation_pages.ts b/x-pack/test/functional/apps/upgrade_assistant/deprecation_pages.ts index 19b4fad72d272..0167ed424850e 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/deprecation_pages.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/deprecation_pages.ts @@ -27,7 +27,7 @@ export default function upgradeAssistantFunctionalTests({ try { /** * Trigger "Total shards" ES Upgrade readiness check - * the number of shards in the test cluster is 25-27 + * the number of shards in the test cluster is 25-29 * so 5 max shards per node should trigger this check * on both local and CI environments. */ @@ -53,7 +53,7 @@ export default function upgradeAssistantFunctionalTests({ persistent: { cluster: { // initial cluster setting from x-pack/test/functional/config.upgrade_assistant.js - max_shards_per_node: 27, + max_shards_per_node: 29, }, }, }, diff --git a/x-pack/test/functional/config.upgrade_assistant.ts b/x-pack/test/functional/config.upgrade_assistant.ts index a9e0a447a2961..fee6504ae57b4 100644 --- a/x-pack/test/functional/config.upgrade_assistant.ts +++ b/x-pack/test/functional/config.upgrade_assistant.ts @@ -31,7 +31,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { 'cluster.routing.allocation.disk.threshold_enabled=true', // make sure disk thresholds are enabled for UA cluster testing 'cluster.routing.allocation.disk.watermark.low=30%', 'cluster.info.update.interval=10s', - 'cluster.max_shards_per_node=27', + 'cluster.max_shards_per_node=29', ], }, };