Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting/Tests] consolidate functional test configs #52671

Merged
Merged
4 changes: 3 additions & 1 deletion x-pack/test/reporting/api/bwc_existing_indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ export default function ({ getService }) {
describe('existing 6_2 index', () => {
before('load data and add index alias', async () => {
await reportingAPI.deleteAllReportingIndexes();
await esArchiver.load('bwc/6_2');
await esArchiver.load('reporting/bwc/6_2');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsullivan hey sir! Good idea on this pr imho.
One thing though, this test is .skip()'d, maybe unskip and test since we are refactoring?
Looks like it was skipped in September.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BWC tests will be removed in an upcoming PR, since Reporting will no longer be backwards compatible with the legacy 6.x generation URLs as of 8.0. So I don't think we're really interested in seeing that it will start to pass.


// The index name in the 6_2 archive.
const ARCHIVED_REPORTING_INDEX = '.reporting-2018.03.11';
cleanupIndexAlias = await reportingAPI.coerceReportsIntoExistingIndex(ARCHIVED_REPORTING_INDEX);

const stats = await usageAPI.getUsageStats();
expectedCompletedReportCount = await reportingAPI.getCompletedReportCount(stats);

await esArchiver.unload('reporting/bwc/6_2');
});

after('remove index alias', async () => {
Expand Down
8 changes: 6 additions & 2 deletions x-pack/test/reporting/api/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function ({ getService }) {

describe('from archive data', () => {
it('generated from 6.2', async () => {
await esArchiver.load('bwc/6_2');
await esArchiver.load('reporting/bwc/6_2');
const usage = await usageAPI.getUsageStats();

reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 0);
Expand All @@ -64,11 +64,13 @@ export default function ({ getService }) {
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 0);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 0);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 0);

await esArchiver.unload('reporting/bwc/6_2');
});


it('generated from 6.3', async () => {
await esArchiver.load('bwc/6_3');
await esArchiver.load('reporting/bwc/6_3');
const usage = await usageAPI.getUsageStats();

reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 0);
Expand All @@ -84,6 +86,8 @@ export default function ({ getService }) {
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 3);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 3);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 3);

await esArchiver.unload('reporting/bwc/6_3');
});
});

Expand Down
41 changes: 0 additions & 41 deletions x-pack/test/reporting/configs/api.js

This file was deleted.

28 changes: 17 additions & 11 deletions x-pack/test/reporting/configs/chromium_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { getReportingApiConfig } from './api';
import { ReportingAPIProvider } from '../services';

export default async function ({ readConfigFile }) {

const reportingApiConfig = await getReportingApiConfig({ readConfigFile });
const apiConfig = await readConfigFile(require.resolve('../../api_integration/config.js'));
const functionalConfig = await readConfigFile(require.resolve('../../functional/config.js'));

return {
...reportingApiConfig,
junit: {
reportName: 'X-Pack Chromium API Reporting Tests',
},
servers: apiConfig.get('servers'),
junit: { reportName: 'X-Pack Chromium API Reporting Tests' },
testFiles: [require.resolve('../api/chromium_tests')],
services: {
...apiConfig.get('services'),
reportingAPI: ReportingAPIProvider,
},
kbnTestServer: {
...reportingApiConfig.kbnTestServer,
...apiConfig.get('kbnTestServer'),
serverArgs: [
...reportingApiConfig.kbnTestServer.serverArgs,
...functionalConfig.get('kbnTestServer.serverArgs'), // optimizer config
tsullivan marked this conversation as resolved.
Show resolved Hide resolved
'--logging.events.log', '["info","warning","error","fatal","optimize","reporting"]',
'--xpack.endpoint.enabled=true',
'--xpack.reporting.csv.enablePanelActionDownload=true',
`--xpack.reporting.capture.browser.type=chromium`,
`--xpack.spaces.enabled=false`,
'--xpack.security.session.idleTimeout=3600000',
'--xpack.spaces.enabled=false',
],
},
esArchiver: apiConfig.get('esArchiver'),
esTestCluster: apiConfig.get('esTestCluster'),
};
}
22 changes: 14 additions & 8 deletions x-pack/test/reporting/configs/chromium_functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { getFunctionalConfig } from './functional';

export default async function ({ readConfigFile }) {

const functionalConfig = await getFunctionalConfig({ readConfigFile });
const functionalConfig = await readConfigFile(require.resolve('../../functional/config.js'));

return {
...functionalConfig,
services: functionalConfig.get('services'),
pageObjects: functionalConfig.get('pageObjects'),
servers: functionalConfig.get('servers'),
apps: functionalConfig.get('apps'),
screenshots: functionalConfig.get('screenshots'),
tsullivan marked this conversation as resolved.
Show resolved Hide resolved
junit: {
reportName: 'X-Pack Chromium Functional Reporting Tests',
},
testFiles: [require.resolve('../functional')],
kbnTestServer: {
...functionalConfig.kbnTestServer,
...functionalConfig.get('kbnTestServer'),
serverArgs: [
...functionalConfig.kbnTestServer.serverArgs,
...functionalConfig.get('kbnTestServer.serverArgs'),
'--logging.events.log', '["info","warning","error","fatal","optimize","reporting"]',
'--xpack.endpoint.enabled=true',
'--xpack.reporting.csv.enablePanelActionDownload=true',
`--xpack.reporting.capture.browser.type=chromium`,
'--xpack.security.session.idleTimeout=3600000',
'--xpack.spaces.enabled=false',
],
},
esArchiver: functionalConfig.get('esArchiver'),
esTestCluster: functionalConfig.get('esTestCluster'),
};
}
36 changes: 0 additions & 36 deletions x-pack/test/reporting/configs/functional.js

This file was deleted.

33 changes: 14 additions & 19 deletions x-pack/test/reporting/configs/generate_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,37 @@

import { esTestConfig, kbnTestConfig, kibanaServerTestUser } from '@kbn/test';
import { format as formatUrl } from 'url';
import { getApiIntegrationConfig } from '../../api_integration/config';
import { getReportingApiConfig } from './api';
import { ReportingAPIProvider } from '../services';

export default async function ({ readConfigFile }) {
const servers = {
kibana: kbnTestConfig.getUrlParts(),
elasticsearch: esTestConfig.getUrlParts(),
};

const apiTestConfig = await getApiIntegrationConfig({ readConfigFile });
const reportingApiConfig = await getReportingApiConfig({ readConfigFile });
const xPackFunctionalTestsConfig = await readConfigFile(require.resolve('../../functional/config.js'));
const apiConfig = await readConfigFile(require.resolve('../../api_integration/config.js'));

return {
...reportingApiConfig,
servers: apiConfig.get('servers'),
junit: { reportName: 'X-Pack Reporting Generate API Integration Tests' },
testFiles: [require.resolve('../api/generate')],
services: {
...apiTestConfig.services,
...reportingApiConfig.services,
...apiConfig.get('services'),
reportingAPI: ReportingAPIProvider,
},
kbnTestServer: {
...xPackFunctionalTestsConfig.get('kbnTestServer'),
...apiConfig.get('kbnTestServer'),
serverArgs: [
`--optimize.enabled=false`,
'--logging.events.log', '["info","warning","error","fatal","optimize","reporting"]',
`--elasticsearch.hosts=${formatUrl(esTestConfig.getUrlParts())}`,
`--elasticsearch.password=${kibanaServerTestUser.password}`,
`--elasticsearch.username=${kibanaServerTestUser.username}`,
`--logging.json=false`,
`--optimize.enabled=false`,
`--server.maxPayloadBytes=1679958`,
`--server.port=${kbnTestConfig.getPort()}`,
`--elasticsearch.hosts=${formatUrl(servers.elasticsearch)}`,
`--elasticsearch.username=${kibanaServerTestUser.username}`,
`--elasticsearch.password=${kibanaServerTestUser.password}`,
`--xpack.reporting.csv.enablePanelActionDownload=true`,
`--xpack.reporting.csv.maxSizeBytes=2850`,
`--xpack.reporting.queue.pollInterval=3000`,
`--xpack.spaces.enabled=false`,
],
},
esArchiver: apiTestConfig.esArchiver,
esArchiver: apiConfig.get('esArchiver'),
esTestCluster: apiConfig.get('esTestCluster'),
};
}
Binary file not shown.
90 changes: 0 additions & 90 deletions x-pack/test/reporting/es_archives/current/reporting/mappings.json

This file was deleted.

Binary file not shown.
Loading