Skip to content

Commit

Permalink
[lens] split group3 into 3 configs
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko committed Apr 27, 2023
1 parent 61c82dc commit f2e7825
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ enabled:
- x-pack/test/functional/apps/lens/group1/config.ts
- x-pack/test/functional/apps/lens/group2/config.ts
- x-pack/test/functional/apps/lens/group3/config.ts
- x-pack/test/functional/apps/lens/group4/config.ts
- x-pack/test/functional/apps/lens/group5/config.ts
- x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts
- x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts
- x-pack/test/functional/apps/lens/open_in_lens/dashboard/config.ts
Expand Down
43 changes: 24 additions & 19 deletions x-pack/test/functional/apps/lens/group3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,30 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
await kibanaServer.savedObjects.cleanStandardList();
});

loadTestFile(require.resolve('./colors'));
loadTestFile(require.resolve('./chart_data'));
loadTestFile(require.resolve('./time_shift'));
loadTestFile(require.resolve('./drag_and_drop'));
loadTestFile(require.resolve('./disable_auto_apply'));
loadTestFile(require.resolve('./geo_field'));
loadTestFile(require.resolve('./formula'));
loadTestFile(require.resolve('./heatmap'));
loadTestFile(require.resolve('./gauge'));
loadTestFile(require.resolve('./metric'));
loadTestFile(require.resolve('./legacy_metric'));
loadTestFile(require.resolve('./reference_lines'));
loadTestFile(require.resolve('./annotations'));
loadTestFile(require.resolve('./inspector'));
loadTestFile(require.resolve('./error_handling'));
loadTestFile(require.resolve('./lens_tagging'));
loadTestFile(require.resolve('./lens_reporting'));
// group 3 - 11m 30s
loadTestFile(require.resolve('./colors')); // 1m 2s
loadTestFile(require.resolve('./chart_data')); // 1m 10s
loadTestFile(require.resolve('./time_shift')); // 1m
loadTestFile(require.resolve('./drag_and_drop')); // 7m 40s
loadTestFile(require.resolve('./geo_field')); // 26s

// group 4 - 12m 30s
// loadTestFile(require.resolve('./formula')); // 5m 52s
// loadTestFile(require.resolve('./heatmap')); // 51s
// loadTestFile(require.resolve('./gauge')); // 1m 17s
// loadTestFile(require.resolve('./metric')); // 4m 7s
// loadTestFile(require.resolve('./legacy_metric')); // 29s

// group 5 - 11m 30s
// loadTestFile(require.resolve('./disable_auto_apply')); // 1m 6s
// loadTestFile(require.resolve('./reference_lines')); // 1m
// loadTestFile(require.resolve('./annotations')); // 1m
// loadTestFile(require.resolve('./inspector')); // 1m 19s
// loadTestFile(require.resolve('./error_handling')); // 1m 8s
// loadTestFile(require.resolve('./lens_tagging')); // 1m 9s
// loadTestFile(require.resolve('./lens_reporting')); // 3m
// keep these two last in the group in this order because they are messing with the default saved objects
loadTestFile(require.resolve('./rollup'));
loadTestFile(require.resolve('./no_data'));
// loadTestFile(require.resolve('./rollup')); // 1m 30s
// loadTestFile(require.resolve('./no_data')); // 36s
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/apps/lens/group4/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
};
}
80 changes: 80 additions & 0 deletions x-pack/test/functional/apps/lens/group4/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { EsArchiver } from '@kbn/es-archiver';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => {
const browser = getService('browser');
const log = getService('log');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['timePicker']);
const config = getService('config');
let remoteEsArchiver;

describe('lens app - group 4', () => {
const esArchive = 'x-pack/test/functional/es_archives/logstash_functional';
const localIndexPatternString = 'logstash-*';
const remoteIndexPatternString = 'ftr-remote:logstash-*';
const localFixtures = {
lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json',
lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default',
};

const remoteFixtures = {
lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json',
lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default',
};
let esNode: EsArchiver;
let fixtureDirs: {
lensBasic: string;
lensDefault: string;
};
let indexPatternString: string;
before(async () => {
log.debug('Starting lens before method');
await browser.setWindowSize(1280, 1200);
await kibanaServer.savedObjects.cleanStandardList();
try {
config.get('esTestCluster.ccs');
remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver');
esNode = remoteEsArchiver;
fixtureDirs = remoteFixtures;
indexPatternString = remoteIndexPatternString;
} catch (error) {
esNode = esArchiver;
fixtureDirs = localFixtures;
indexPatternString = localIndexPatternString;
}

await esNode.load(esArchive);
// changing the timepicker default here saves us from having to set it in Discover (~8s)
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
defaultIndex: indexPatternString,
'dateFormat:tz': 'UTC',
});
await kibanaServer.importExport.load(fixtureDirs.lensBasic);
await kibanaServer.importExport.load(fixtureDirs.lensDefault);
});

after(async () => {
await esArchiver.unload(esArchive);
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.importExport.unload(fixtureDirs.lensBasic);
await kibanaServer.importExport.unload(fixtureDirs.lensDefault);
await kibanaServer.savedObjects.cleanStandardList();
});

loadTestFile(require.resolve('./formula')); // 5m 52s
loadTestFile(require.resolve('./heatmap')); // 51s
loadTestFile(require.resolve('./gauge')); // 1m 17s
loadTestFile(require.resolve('./metric')); // 4m 7s
loadTestFile(require.resolve('./legacy_metric')); // 29s
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/apps/lens/group5/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
};
}
85 changes: 85 additions & 0 deletions x-pack/test/functional/apps/lens/group5/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { EsArchiver } from '@kbn/es-archiver';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => {
const browser = getService('browser');
const log = getService('log');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['timePicker']);
const config = getService('config');
let remoteEsArchiver;

describe('lens app - group 5', () => {
const esArchive = 'x-pack/test/functional/es_archives/logstash_functional';
const localIndexPatternString = 'logstash-*';
const remoteIndexPatternString = 'ftr-remote:logstash-*';
const localFixtures = {
lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json',
lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default',
};

const remoteFixtures = {
lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json',
lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default',
};
let esNode: EsArchiver;
let fixtureDirs: {
lensBasic: string;
lensDefault: string;
};
let indexPatternString: string;
before(async () => {
log.debug('Starting lens before method');
await browser.setWindowSize(1280, 1200);
await kibanaServer.savedObjects.cleanStandardList();
try {
config.get('esTestCluster.ccs');
remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver');
esNode = remoteEsArchiver;
fixtureDirs = remoteFixtures;
indexPatternString = remoteIndexPatternString;
} catch (error) {
esNode = esArchiver;
fixtureDirs = localFixtures;
indexPatternString = localIndexPatternString;
}

await esNode.load(esArchive);
// changing the timepicker default here saves us from having to set it in Discover (~8s)
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
defaultIndex: indexPatternString,
'dateFormat:tz': 'UTC',
});
await kibanaServer.importExport.load(fixtureDirs.lensBasic);
await kibanaServer.importExport.load(fixtureDirs.lensDefault);
});

after(async () => {
await esArchiver.unload(esArchive);
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.importExport.unload(fixtureDirs.lensBasic);
await kibanaServer.importExport.unload(fixtureDirs.lensDefault);
await kibanaServer.savedObjects.cleanStandardList();
});

loadTestFile(require.resolve('./disable_auto_apply')); // 1m 6s
loadTestFile(require.resolve('./reference_lines')); // 1m
loadTestFile(require.resolve('./annotations')); // 1m
loadTestFile(require.resolve('./inspector')); // 1m 19s
loadTestFile(require.resolve('./error_handling')); // 1m 8s
loadTestFile(require.resolve('./lens_tagging')); // 1m 9s
loadTestFile(require.resolve('./lens_reporting')); // 3m
// keep these two last in the group in this order because they are messing with the default saved objects
loadTestFile(require.resolve('./rollup')); // 1m 30s
loadTestFile(require.resolve('./no_data')); // 36s
});
};

0 comments on commit f2e7825

Please sign in to comment.