Skip to content

Commit

Permalink
[ML] Transforms: Enable SLO transforms installer on CI (#165470)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
walterra authored Sep 22, 2023
1 parent f52ca02 commit cdaa3d3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions x-pack/performance/journeys/many_fields_transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/transform/public/app/hooks/use_index_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/config.upgrade_assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
},
};
Expand Down

0 comments on commit cdaa3d3

Please sign in to comment.