forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (elastic…
…#107592) Co-authored-by: spalger <[email protected]>
- Loading branch information
Showing
15 changed files
with
415 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
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,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, | ||
}, | ||
}; | ||
} |
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('ciGroup8'); | ||
|
||
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); | ||
}); | ||
}); | ||
} |