-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perf-testing] send detailed APM data from report generation
- Loading branch information
Showing
14 changed files
with
403 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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'; | ||
|
||
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: | ||
'https://2fad4006bf784bb8a54e52f4a5862609.apm.us-west1.gcp.cloud.es.io:443', | ||
ELASTIC_APM_SECRET_TOKEN: 'Q5q5rWQEw6tKeirBpw', | ||
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}`), ''), | ||
}, | ||
}, | ||
}; | ||
} |
Binary file not shown.
41 changes: 41 additions & 0 deletions
41
x-pack/test/performance/es_archives/reporting_dashboard/mappings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<typeof services, typeof pageObjects>; | ||
export class FtrService extends GenericFtrService<FtrProviderContext> {} |
193 changes: 193 additions & 0 deletions
193
x-pack/test/performance/kbn_archives/reporting_dashboard.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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('ciGroup1'); | ||
|
||
loadTestFile(require.resolve('./reporting_dashboard')); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
}); | ||
} |