diff --git a/packages/kbn-apm-config-loader/src/config.ts b/packages/kbn-apm-config-loader/src/config.ts index fe5ed52c53baa..1436d396aae59 100644 --- a/packages/kbn-apm-config-loader/src/config.ts +++ b/packages/kbn-apm-config-loader/src/config.ts @@ -122,6 +122,19 @@ export class ApmConfiguration { config.transactionSampleRate = parseFloat(process.env.ELASTIC_APM_TRANSACTION_SAMPLE_RATE); } + if (process.env.ELASTIC_APM_SERVER_URL) { + config.serverUrl = process.env.ELASTIC_APM_SERVER_URL; + } + + if (process.env.ELASTIC_APM_GLOBAL_LABELS) { + config.globalLabels = Object.fromEntries( + process.env.ELASTIC_APM_GLOBAL_LABELS.split(',').map((p) => { + const [key, ...val] = p.split('='); + return [key, val.join('=')]; + }) + ); + } + return config; } diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts index f9877447840da..37bb465e8e5b7 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts @@ -200,6 +200,8 @@ export const schema = Joi.object() .default(/Kibana is now available/), }) .default(), + env: Joi.object().unknown().default(), + delayShutdown: Joi.number(), }) .default(), diff --git a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js b/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js index 3154d77488ba6..6f91304fffa27 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js +++ b/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js @@ -29,6 +29,7 @@ function extendNodeOptions(installDir) { export async function runKibanaServer({ procs, config, options }) { const { installDir } = options; const runOptions = config.get('kbnTestServer.runOptions'); + const env = config.get('kbnTestServer.env'); await procs.run('kibana', { cmd: getKibanaCmd(installDir), @@ -36,6 +37,7 @@ export async function runKibanaServer({ procs, config, options }) { env: { FORCE_COLOR: 1, ...process.env, + ...env, ...extendNodeOptions(installDir), }, cwd: installDir || KIBANA_ROOT, diff --git a/packages/kbn-test/src/functional_tests/tasks.js b/packages/kbn-test/src/functional_tests/tasks.js index f4dfdcb93fb2b..00b04fcda26db 100644 --- a/packages/kbn-test/src/functional_tests/tasks.js +++ b/packages/kbn-test/src/functional_tests/tasks.js @@ -100,6 +100,12 @@ export async function runTests(options) { await runFtr({ configPath, options: opts }); } finally { try { + const delay = config.get('kbnTestServer.delayShutdown'); + if (typeof delay === 'number') { + log.info('Delaying shutdown of Kibana for', delay, 'ms'); + await new Promise((r) => setTimeout(r, delay)); + } + await procs.stop('kibana'); } finally { if (es) { diff --git a/vars/workers.groovy b/vars/workers.groovy index 4f9fc789a04b3..ca1c6b57c18bb 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -99,8 +99,10 @@ def base(Map params, Closure closure) { withEnv([ "CI=true", "HOME=${env.JENKINS_HOME}", + "PR_NUMBER=${env.ghprbPullId ?: ''}", "PR_SOURCE_BRANCH=${env.ghprbSourceBranch ?: ''}", "PR_TARGET_BRANCH=${env.ghprbTargetBranch ?: ''}", + "PR_MERGE_BASE=${checkoutInfo.mergeBase ?: ''}", "PR_AUTHOR=${env.ghprbPullAuthorLogin ?: ''}", "TEST_BROWSER_HEADLESS=1", "GIT_COMMIT=${checkoutInfo.commit}", diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index 9e527835231b4..2ef5004726eb2 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -88,6 +88,7 @@ const onlyNotInCoverageTests = [ require.resolve('../test/saved_object_tagging/api_integration/security_and_spaces/config.ts'), require.resolve('../test/saved_object_tagging/api_integration/tagging_api/config.ts'), require.resolve('../test/examples/config.ts'), + require.resolve('../test/performance/config.ts'), ]; require('../../src/setup_node_env'); diff --git a/x-pack/test/performance/config.ts b/x-pack/test/performance/config.ts new file mode 100644 index 0000000000000..89b7b52e28670 --- /dev/null +++ b/x-pack/test/performance/config.ts @@ -0,0 +1,56 @@ +/* + * 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'; + +import { services } from './services'; +import { pageObjects } from './page_objects'; + +// These "secret" values are intentionally written in the source. We would make the APM server accept annonymous traffic if we could +const APM_SERVER_URL = 'https://2fad4006bf784bb8a54e52f4a5862609.apm.us-west1.gcp.cloud.es.io:443'; +const APM_PUBLIC_TOKEN = 'Q5q5rWQEw6tKeirBpw'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../functional/config')); + + return { + testFiles: [require.resolve('./tests/index.ts')], + services, + pageObjects, + servers: functionalConfig.get('servers'), + esTestCluster: functionalConfig.get('esTestCluster'), + apps: functionalConfig.get('apps'), + screenshots: functionalConfig.get('screenshots'), + junit: { + reportName: 'Performance Tests', + }, + kbnTestServer: { + ...functionalConfig.get('kbnTestServer'), + env: { + ELASTIC_APM_ACTIVE: 'true', + ELASTIC_APM_ENVIRONMENT: process.env.CI ? 'ci' : 'development', + ELASTIC_APM_TRANSACTION_SAMPLE_RATE: '1.0', + ELASTIC_APM_SERVER_URL: APM_SERVER_URL, + ELASTIC_APM_SECRET_TOKEN: APM_PUBLIC_TOKEN, + ELASTIC_APM_GLOBAL_LABELS: Object.entries({ + ftrConfig: `x-pack/test/performance`, + jenkinsJobName: process.env.JOB_NAME, + jenkinsBuildNumber: process.env.BUILD_NUMBER, + prId: process.env.PR_NUMBER, + branch: process.env.GIT_BRANCH, + commit: process.env.GIT_COMMIT, + mergeBase: process.env.PR_MERGE_BASE, + targetBranch: process.env.PR_TARGET_BRANCH, + }) + .filter(([, v]) => !!v) + .reduce((acc, [k, v]) => (acc ? `${acc},${k}=${v}` : `${k}=${v}`), ''), + }, + // delay shutdown by 15 seconds to ensure that APM can report the data it collects during test execution + delayShutdown: 15_000, + }, + }; +} diff --git a/x-pack/test/performance/es_archives/reporting_dashboard/data.json.gz b/x-pack/test/performance/es_archives/reporting_dashboard/data.json.gz new file mode 100644 index 0000000000000..7631d7eef2300 Binary files /dev/null and b/x-pack/test/performance/es_archives/reporting_dashboard/data.json.gz differ diff --git a/x-pack/test/performance/es_archives/reporting_dashboard/mappings.json b/x-pack/test/performance/es_archives/reporting_dashboard/mappings.json new file mode 100644 index 0000000000000..a4f39b8ab3cfa --- /dev/null +++ b/x-pack/test/performance/es_archives/reporting_dashboard/mappings.json @@ -0,0 +1,41 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "foo", + "mappings": { + "properties": { + "@timestamp": { + "type": "date" + }, + "group": { + "ignore_above": 256, + "type": "keyword" + }, + "randomInt": { + "type": "integer" + }, + "geo": { + "properties": { + "country_code": { + "type": "keyword" + }, + "country_name": { + "type": "keyword" + }, + "point": { + "type": "geo_point" + } + } + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} diff --git a/x-pack/test/performance/ftr_provider_context.ts b/x-pack/test/performance/ftr_provider_context.ts new file mode 100644 index 0000000000000..e757164fa1de9 --- /dev/null +++ b/x-pack/test/performance/ftr_provider_context.ts @@ -0,0 +1,14 @@ +/* + * 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 { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; + +import { pageObjects } from './page_objects'; +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/x-pack/test/performance/kbn_archives/reporting_dashboard.json b/x-pack/test/performance/kbn_archives/reporting_dashboard.json new file mode 100644 index 0000000000000..fe9edc0274da0 --- /dev/null +++ b/x-pack/test/performance/kbn_archives/reporting_dashboard.json @@ -0,0 +1,193 @@ +{ + "attributes": { + "fieldAttrs": "{}", + "fields": "[]", + "timeFieldName": "@timestamp", + "title": "foo" + }, + "coreMigrationVersion": "8.0.0", + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "migrationVersion": { + "index-pattern": "7.11.0" + }, + "references": [], + "type": "index-pattern", + "updated_at": "2021-08-03T02:30:35.243Z", + "version": "Wzg0NCwxXQ==" +} + +{ + "attributes": { + "columns": [ + "_source" + ], + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [], + "title": "search", + "version": 1 + }, + "coreMigrationVersion": "8.0.0", + "id": "0c0b1700-2dc6-11eb-8af3-cb3aa84dbabd", + "migrationVersion": { + "search": "7.9.3" + }, + "references": [ + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "search", + "updated_at": "2021-08-03T02:30:35.243Z", + "version": "Wzg0NSwxXQ==" +} + +{ + "attributes": { + "description": "", + "state": { + "datasourceStates": { + "indexpattern": { + "layers": { + "c6af0915-fc1c-41b5-b195-7b05a51b0271": { + "columnOrder": [ + "0ee222c6-215d-4adc-aac0-b45469d5f9c1" + ], + "columns": { + "0ee222c6-215d-4adc-aac0-b45469d5f9c1": { + "dataType": "number", + "isBucketed": false, + "label": "Average of field", + "operationType": "average", + "scale": "ratio", + "sourceField": "field" + } + } + } + } + } + }, + "filters": [], + "query": { + "language": "kuery", + "query": "" + }, + "visualization": { + "accessor": "0ee222c6-215d-4adc-aac0-b45469d5f9c1", + "layerId": "c6af0915-fc1c-41b5-b195-7b05a51b0271" + } + }, + "title": "visualization", + "visualizationType": "lnsMetric" + }, + "coreMigrationVersion": "8.0.0", + "id": "2be82220-2dc6-11eb-8af3-cb3aa84dbabd", + "migrationVersion": { + "lens": "7.14.0" + }, + "references": [ + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "indexpattern-datasource-layer-c6af0915-fc1c-41b5-b195-7b05a51b0271", + "type": "index-pattern" + } + ], + "type": "lens", + "updated_at": "2021-08-03T02:30:35.243Z", + "version": "Wzg0NiwxXQ==" +} + +{ + "attributes": { + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"8b528b1e-a8da-4a62-a667-9524370f3f9c\"},\"panelIndex\":\"8b528b1e-a8da-4a62-a667-9524370f3f9c\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsXY\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"5ea9080d-1b03-49ea-8d74-b1b0ec785508\":{\"columns\":{\"d73c1d27-24c0-4b8d-b355-5f16337c271d\":{\"label\":\"Top values of group\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"group\",\"isBucketed\":true,\"params\":{\"size\":30,\"orderBy\":{\"type\":\"column\",\"columnId\":\"0bd996a2-80ff-4c62-a8a0-c2752a8ca9e3\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"b9aca667-73eb-49eb-bfe2-765e1a3bfecb\":{\"label\":\"@timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"@timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\"}},\"0bd996a2-80ff-4c62-a8a0-c2752a8ca9e3\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"d73c1d27-24c0-4b8d-b355-5f16337c271d\",\"b9aca667-73eb-49eb-bfe2-765e1a3bfecb\",\"0bd996a2-80ff-4c62-a8a0-c2752a8ca9e3\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"line\",\"layers\":[{\"layerId\":\"5ea9080d-1b03-49ea-8d74-b1b0ec785508\",\"accessors\":[\"0bd996a2-80ff-4c62-a8a0-c2752a8ca9e3\"],\"position\":\"top\",\"seriesType\":\"line\",\"showGridlines\":false,\"xAccessor\":\"b9aca667-73eb-49eb-bfe2-765e1a3bfecb\",\"splitAccessor\":\"d73c1d27-24c0-4b8d-b355-5f16337c271d\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-layer-5ea9080d-1b03-49ea-8d74-b1b0ec785508\"}]},\"enhancements\":{}}},{\"version\":\"8.0.0\",\"type\":\"search\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"a719fa94-58cc-4023-b95d-5aec25315045\"},\"panelIndex\":\"a719fa94-58cc-4023-b95d-5aec25315045\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_a719fa94-58cc-4023-b95d-5aec25315045\"},{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":15,\"w\":24,\"h\":15,\"i\":\"48e8bad8-53fa-490c-a433-3917b8844718\"},\"panelIndex\":\"48e8bad8-53fa-490c-a433-3917b8844718\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsXY\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"98273c17-bb3f-4411-9e39-2e244577b14d\":{\"columns\":{\"92e17bbb-9774-467c-8e1e-95fccccaa72c\":{\"label\":\"Top values of geo.country_code\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"geo.country_code\",\"isBucketed\":true,\"params\":{\"size\":3,\"orderBy\":{\"type\":\"column\",\"columnId\":\"43d2d90b-a3cd-40fe-ba98-2b384d41bde0\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"5930e809-738d-4966-9aa4-1ceab4b8fee0\":{\"label\":\"@timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"@timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\"}},\"43d2d90b-a3cd-40fe-ba98-2b384d41bde0\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"},\"92986504-3b17-43cc-b6ba-71456b05cd81\":{\"label\":\"Median of randomInt\",\"dataType\":\"number\",\"operationType\":\"median\",\"sourceField\":\"randomInt\",\"isBucketed\":false,\"scale\":\"ratio\"}},\"columnOrder\":[\"92e17bbb-9774-467c-8e1e-95fccccaa72c\",\"5930e809-738d-4966-9aa4-1ceab4b8fee0\",\"43d2d90b-a3cd-40fe-ba98-2b384d41bde0\",\"92986504-3b17-43cc-b6ba-71456b05cd81\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"area_percentage_stacked\",\"layers\":[{\"layerId\":\"98273c17-bb3f-4411-9e39-2e244577b14d\",\"accessors\":[\"43d2d90b-a3cd-40fe-ba98-2b384d41bde0\",\"92986504-3b17-43cc-b6ba-71456b05cd81\"],\"position\":\"top\",\"seriesType\":\"area_percentage_stacked\",\"showGridlines\":false,\"xAccessor\":\"5930e809-738d-4966-9aa4-1ceab4b8fee0\",\"splitAccessor\":\"92e17bbb-9774-467c-8e1e-95fccccaa72c\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-layer-98273c17-bb3f-4411-9e39-2e244577b14d\"}]},\"enhancements\":{}}},{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":15,\"w\":24,\"h\":15,\"i\":\"cd6222f7-9db1-49b3-bdd1-b0a7b8b580f5\"},\"panelIndex\":\"cd6222f7-9db1-49b3-bdd1-b0a7b8b580f5\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsXY\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"bd86ba26-72d3-4338-b962-5f69e2b7a693\":{\"columns\":{\"cfbd0aec-f3f9-4e87-99ba-686537b7f51e\":{\"label\":\"Top values of geo.country_code\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"geo.country_code\",\"isBucketed\":true,\"params\":{\"size\":200,\"orderBy\":{\"type\":\"column\",\"columnId\":\"c36080f3-db58-45ed-9193-b2a9ff05f710\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"b0af72ea-46a9-42b2-a55f-6a5614c814fa\":{\"label\":\"@timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"@timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\"}},\"c36080f3-db58-45ed-9193-b2a9ff05f710\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"cfbd0aec-f3f9-4e87-99ba-686537b7f51e\",\"b0af72ea-46a9-42b2-a55f-6a5614c814fa\",\"c36080f3-db58-45ed-9193-b2a9ff05f710\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"labelsOrientation\":{\"x\":0,\"yLeft\":0,\"yRight\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yLeft\":true,\"yRight\":true},\"preferredSeriesType\":\"bar_stacked\",\"layers\":[{\"layerId\":\"bd86ba26-72d3-4338-b962-5f69e2b7a693\",\"accessors\":[\"c36080f3-db58-45ed-9193-b2a9ff05f710\"],\"position\":\"top\",\"seriesType\":\"bar_stacked\",\"showGridlines\":false,\"xAccessor\":\"b0af72ea-46a9-42b2-a55f-6a5614c814fa\",\"splitAccessor\":\"cfbd0aec-f3f9-4e87-99ba-686537b7f51e\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-layer-bd86ba26-72d3-4338-b962-5f69e2b7a693\"}]},\"enhancements\":{}}},{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":0,\"y\":30,\"w\":24,\"h\":15,\"i\":\"2316251f-b789-4864-bca9-b2473851c221\"},\"panelIndex\":\"2316251f-b789-4864-bca9-b2473851c221\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsPie\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"e0fa5d77-06a7-4f87-9e71-f8727829ed78\":{\"columns\":{\"ec8d42da-bba6-46b9-b11f-4aba33f30704\":{\"label\":\"Top values of geo.country_name\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"geo.country_name\",\"isBucketed\":true,\"params\":{\"size\":500,\"orderBy\":{\"type\":\"column\",\"columnId\":\"acb7ed45-a2b8-429e-9b35-c6d7e34afbee\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"acb7ed45-a2b8-429e-9b35-c6d7e34afbee\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"},\"8b6de72d-1157-4d98-8de7-6c909942826b\":{\"label\":\"Top values of group\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"group\",\"isBucketed\":true,\"params\":{\"size\":3,\"orderBy\":{\"type\":\"column\",\"columnId\":\"acb7ed45-a2b8-429e-9b35-c6d7e34afbee\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}}},\"columnOrder\":[\"ec8d42da-bba6-46b9-b11f-4aba33f30704\",\"8b6de72d-1157-4d98-8de7-6c909942826b\",\"acb7ed45-a2b8-429e-9b35-c6d7e34afbee\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"shape\":\"treemap\",\"layers\":[{\"layerId\":\"e0fa5d77-06a7-4f87-9e71-f8727829ed78\",\"groups\":[\"ec8d42da-bba6-46b9-b11f-4aba33f30704\",\"8b6de72d-1157-4d98-8de7-6c909942826b\"],\"metric\":\"acb7ed45-a2b8-429e-9b35-c6d7e34afbee\",\"numberDisplay\":\"percent\",\"categoryDisplay\":\"default\",\"legendDisplay\":\"default\",\"nestedLegend\":false}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-layer-e0fa5d77-06a7-4f87-9e71-f8727829ed78\"}]},\"enhancements\":{}}},{\"version\":\"8.0.0\",\"type\":\"lens\",\"gridData\":{\"x\":24,\"y\":30,\"w\":24,\"h\":15,\"i\":\"2889665f-3703-4057-96a5-9d0fe2f79dba\"},\"panelIndex\":\"2889665f-3703-4057-96a5-9d0fe2f79dba\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"type\":\"lens\",\"visualizationType\":\"lnsPie\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"2405161c-3904-4b41-a1c7-4a368bd1f0c6\":{\"columns\":{\"ef810dda-cc9f-412f-a90e-cd0cf05dae91\":{\"label\":\"Top values of geo.country_code\",\"dataType\":\"string\",\"operationType\":\"terms\",\"scale\":\"ordinal\",\"sourceField\":\"geo.country_code\",\"isBucketed\":true,\"params\":{\"size\":500,\"orderBy\":{\"type\":\"column\",\"columnId\":\"38c4ec2f-4d31-48a8-8305-b9cd0ee92911\"},\"orderDirection\":\"desc\",\"otherBucket\":true,\"missingBucket\":false}},\"38c4ec2f-4d31-48a8-8305-b9cd0ee92911\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"ef810dda-cc9f-412f-a90e-cd0cf05dae91\",\"38c4ec2f-4d31-48a8-8305-b9cd0ee92911\"],\"incompleteColumns\":{}}}}},\"visualization\":{\"shape\":\"donut\",\"layers\":[{\"layerId\":\"2405161c-3904-4b41-a1c7-4a368bd1f0c6\",\"groups\":[\"ef810dda-cc9f-412f-a90e-cd0cf05dae91\"],\"metric\":\"38c4ec2f-4d31-48a8-8305-b9cd0ee92911\",\"numberDisplay\":\"percent\",\"categoryDisplay\":\"default\",\"legendDisplay\":\"default\",\"nestedLegend\":false}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\",\"name\":\"indexpattern-datasource-layer-2405161c-3904-4b41-a1c7-4a368bd1f0c6\"}]},\"enhancements\":{}}},{\"version\":\"8.0.0\",\"type\":\"map\",\"gridData\":{\"x\":0,\"y\":45,\"w\":48,\"h\":35,\"i\":\"83c116f7-8024-446d-9562-88193ffd1a4d\"},\"panelIndex\":\"83c116f7-8024-446d-9562-88193ffd1a4d\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"description\":\"\",\"layerListJSON\":\"[{\\\"sourceDescriptor\\\":{\\\"type\\\":\\\"EMS_TMS\\\",\\\"isAutoSelect\\\":true},\\\"id\\\":\\\"1cee2790-c106-4038-9bf1-9c6b9727f609\\\",\\\"label\\\":null,\\\"minZoom\\\":0,\\\"maxZoom\\\":24,\\\"alpha\\\":1,\\\"visible\\\":true,\\\"style\\\":{\\\"type\\\":\\\"TILE\\\"},\\\"includeInFitToBounds\\\":true,\\\"type\\\":\\\"VECTOR_TILE\\\"},{\\\"sourceDescriptor\\\":{\\\"indexPatternId\\\":\\\"f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd\\\",\\\"geoField\\\":\\\"geo.point\\\",\\\"filterByMapBounds\\\":true,\\\"scalingType\\\":\\\"MVT\\\",\\\"id\\\":\\\"f0f89620-d98e-48ae-9922-120f12bbdd01\\\",\\\"type\\\":\\\"ES_SEARCH\\\",\\\"applyGlobalQuery\\\":true,\\\"applyGlobalTime\\\":true,\\\"tooltipProperties\\\":[],\\\"sortField\\\":\\\"\\\",\\\"sortOrder\\\":\\\"desc\\\",\\\"topHitsSplitField\\\":\\\"\\\",\\\"topHitsSize\\\":1},\\\"id\\\":\\\"de69c1d8-50db-495c-8c13-381e5ee4e338\\\",\\\"label\\\":null,\\\"minZoom\\\":0,\\\"maxZoom\\\":24,\\\"alpha\\\":0.75,\\\"visible\\\":true,\\\"style\\\":{\\\"type\\\":\\\"VECTOR\\\",\\\"properties\\\":{\\\"icon\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"value\\\":\\\"marker\\\"}},\\\"fillColor\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"color\\\":\\\"#54B399\\\"}},\\\"lineColor\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"color\\\":\\\"#41937c\\\"}},\\\"lineWidth\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"size\\\":1}},\\\"iconSize\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"size\\\":6}},\\\"iconOrientation\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"orientation\\\":0}},\\\"labelText\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"value\\\":\\\"\\\"}},\\\"labelColor\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"color\\\":\\\"#000000\\\"}},\\\"labelSize\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"size\\\":14}},\\\"labelBorderColor\\\":{\\\"type\\\":\\\"STATIC\\\",\\\"options\\\":{\\\"color\\\":\\\"#FFFFFF\\\"}},\\\"symbolizeAs\\\":{\\\"options\\\":{\\\"value\\\":\\\"circle\\\"}},\\\"labelBorderSize\\\":{\\\"options\\\":{\\\"size\\\":\\\"SMALL\\\"}}},\\\"isTimeAware\\\":true},\\\"includeInFitToBounds\\\":true,\\\"type\\\":\\\"TILED_VECTOR\\\",\\\"joins\\\":[]}]\",\"mapStateJSON\":\"{\\\"zoom\\\":7.42,\\\"center\\\":{\\\"lon\\\":-1.10319,\\\"lat\\\":53.12713},\\\"timeFilters\\\":{\\\"from\\\":\\\"2021-08-03T02:19:31.649Z\\\",\\\"to\\\":\\\"2021-08-03T02:47:08.470Z\\\"},\\\"refreshConfig\\\":{\\\"isPaused\\\":false,\\\"interval\\\":10000},\\\"query\\\":{\\\"query\\\":\\\"\\\",\\\"language\\\":\\\"kuery\\\"},\\\"filters\\\":[],\\\"settings\\\":{\\\"autoFitToDataBounds\\\":false,\\\"backgroundColor\\\":\\\"#ffffff\\\",\\\"disableInteractive\\\":false,\\\"disableTooltipControl\\\":false,\\\"hideToolbarOverlay\\\":false,\\\"hideLayerControl\\\":false,\\\"hideViewControl\\\":false,\\\"initialLocation\\\":\\\"LAST_SAVED_LOCATION\\\",\\\"fixedLocation\\\":{\\\"lat\\\":0,\\\"lon\\\":0,\\\"zoom\\\":2},\\\"browserLocation\\\":{\\\"zoom\\\":2},\\\"maxZoom\\\":24,\\\"minZoom\\\":0,\\\"showScaleControl\\\":false,\\\"showSpatialFilters\\\":true,\\\"showTimesliderToggleButton\\\":true,\\\"spatialFiltersAlpa\\\":0.3,\\\"spatialFiltersFillColor\\\":\\\"#DA8B45\\\",\\\"spatialFiltersLineColor\\\":\\\"#DA8B45\\\"}}\",\"uiStateJSON\":\"{\\\"isLayerTOCOpen\\\":true,\\\"openTOCDetails\\\":[]}\"},\"mapCenter\":{\"lat\":53.12713,\"lon\":-1.10319,\"zoom\":7.42},\"mapBuffer\":{\"minLon\":-4.21875,\"minLat\":52.48278,\"maxLon\":2.8125,\"maxLat\":54.16243},\"isLayerTOCOpen\":true,\"openTOCDetails\":[],\"hiddenLayers\":[],\"enhancements\":{}}}]", + "timeRestore": false, + "title": "dashboard", + "version": 1 + }, + "coreMigrationVersion": "8.0.0", + "id": "37b49c50-2dc6-11eb-8af3-cb3aa84dbabd", + "migrationVersion": { + "dashboard": "7.14.0" + }, + "references": [ + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "8b528b1e-a8da-4a62-a667-9524370f3f9c:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "8b528b1e-a8da-4a62-a667-9524370f3f9c:indexpattern-datasource-layer-5ea9080d-1b03-49ea-8d74-b1b0ec785508", + "type": "index-pattern" + }, + { + "id": "0c0b1700-2dc6-11eb-8af3-cb3aa84dbabd", + "name": "a719fa94-58cc-4023-b95d-5aec25315045:panel_a719fa94-58cc-4023-b95d-5aec25315045", + "type": "search" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "48e8bad8-53fa-490c-a433-3917b8844718:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "48e8bad8-53fa-490c-a433-3917b8844718:indexpattern-datasource-layer-98273c17-bb3f-4411-9e39-2e244577b14d", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "cd6222f7-9db1-49b3-bdd1-b0a7b8b580f5:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "cd6222f7-9db1-49b3-bdd1-b0a7b8b580f5:indexpattern-datasource-layer-bd86ba26-72d3-4338-b962-5f69e2b7a693", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "2316251f-b789-4864-bca9-b2473851c221:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "2316251f-b789-4864-bca9-b2473851c221:indexpattern-datasource-layer-e0fa5d77-06a7-4f87-9e71-f8727829ed78", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "2889665f-3703-4057-96a5-9d0fe2f79dba:indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "2889665f-3703-4057-96a5-9d0fe2f79dba:indexpattern-datasource-layer-2405161c-3904-4b41-a1c7-4a368bd1f0c6", + "type": "index-pattern" + }, + { + "id": "f8a1e9a0-2dc5-11eb-8af3-cb3aa84dbabd", + "name": "83c116f7-8024-446d-9562-88193ffd1a4d:layer_1_source_index_pattern", + "type": "index-pattern" + } + ], + "type": "dashboard", + "updated_at": "2021-08-03T02:37:36.415Z", + "version": "WzExNjAsMV0=" +} \ No newline at end of file diff --git a/x-pack/test/performance/page_objects.ts b/x-pack/test/performance/page_objects.ts new file mode 100644 index 0000000000000..4744980b82592 --- /dev/null +++ b/x-pack/test/performance/page_objects.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export * from '../functional/page_objects'; diff --git a/x-pack/test/performance/services.ts b/x-pack/test/performance/services.ts new file mode 100644 index 0000000000000..ecaac6362761d --- /dev/null +++ b/x-pack/test/performance/services.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export * from '../functional/services'; diff --git a/x-pack/test/performance/tests/index.ts b/x-pack/test/performance/tests/index.ts new file mode 100644 index 0000000000000..b1023bde688e2 --- /dev/null +++ b/x-pack/test/performance/tests/index.ts @@ -0,0 +1,16 @@ +/* + * 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 { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('performance', function () { + this.tags('ciGroup8'); + + loadTestFile(require.resolve('./reporting_dashboard')); + }); +} diff --git a/x-pack/test/performance/tests/reporting_dashboard.ts b/x-pack/test/performance/tests/reporting_dashboard.ts new file mode 100644 index 0000000000000..f363f8449df96 --- /dev/null +++ b/x-pack/test/performance/tests/reporting_dashboard.ts @@ -0,0 +1,53 @@ +/* + * 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 { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ getService, getPageObject }: FtrProviderContext) { + const retry = getService('retry'); + const es = getService('es'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const common = getPageObject('common'); + const dashboard = getPageObject('dashboard'); + const reporting = getPageObject('reporting'); + + describe('reporting dashbaord', () => { + before(async () => { + await kibanaServer.importExport.load( + 'x-pack/test/performance/kbn_archives/reporting_dashboard' + ); + await esArchiver.loadIfNeeded('x-pack/test/performance/es_archives/reporting_dashboard'); + }); + + after(async () => { + await kibanaServer.importExport.unload( + 'x-pack/test/performance/kbn_archives/reporting_dashboard' + ); + await esArchiver.unload('x-pack/test/performance/es_archives/reporting_dashboard'); + await es.deleteByQuery({ + index: '.reporting-*', + refresh: true, + body: { query: { match_all: {} } }, + }); + }); + + it('downloaded PDF has OK status', async function () { + this.timeout(180000); + + await common.navigateToApp('dashboards'); + await retry.waitFor('dashboard landing page', async () => { + return await dashboard.onDashboardLandingPage(); + }); + await dashboard.loadSavedDashboard('dashboard'); + await reporting.openPdfReportingPanel(); + await reporting.clickGenerateReportButton(); + + await reporting.getReportURL(60000); + }); + }); +}