-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[perf-testing] send detailed APM data from report generation #107592
Merged
spalger
merged 5 commits into
elastic:master
from
spalger:implement/simple-apm-reporting-test
Aug 9, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7e9dc8b
[perf-testing] send detailed APM data from report generation
spalger 8d7c312
comment about lack of secrecy for secret tokens
spalger b033f4f
move tests to ciGroup8 which is the fastest
spalger 3fe1d05
support delaying Kibana shutdown to ensure all APM data is received
spalger 4711d37
Merge branch 'master' into implement/simple-apm-reporting-test
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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); | ||
}); | ||
}); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this
join
? in what casesval
might be an array with length > 1?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the value includes an
=