-
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.
CI Reporter for saved objects field count
- Loading branch information
Showing
4 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
source test/scripts/jenkins_test_setup_xpack.sh | ||
|
||
checks-reporter-with-killswitch "Capture Kibana Saved Objects field count metrics" \ | ||
node scripts/functional_tests \ | ||
--debug --bail \ | ||
--kibana-install-dir "$installDir" \ | ||
--config test/saved_objects_field_count/config.ts; |
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,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { resolve } from 'path'; | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; | ||
import { testRunner } from './runner'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const kibanaCommonTestsConfig = await readConfigFile( | ||
require.resolve('../../../test/common/config.js') | ||
); | ||
const xpackFunctionalTestsConfig = await readConfigFile( | ||
require.resolve('../functional/config.js') | ||
); | ||
|
||
return { | ||
...kibanaCommonTestsConfig.getAll(), | ||
|
||
testRunner, | ||
|
||
esTestCluster: { | ||
...xpackFunctionalTestsConfig.get('esTestCluster'), | ||
serverArgs: [...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs')], | ||
}, | ||
|
||
kbnTestServer: { | ||
...xpackFunctionalTestsConfig.get('kbnTestServer'), | ||
}, | ||
}; | ||
} |
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,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { CiStatsReporter } from '@kbn/dev-utils'; | ||
// @ts-ignore not TS yet | ||
import getUrl from '../../../src/test_utils/get_url'; | ||
|
||
import { FtrProviderContext } from './../functional/ftr_provider_context'; | ||
|
||
export async function testRunner({ getService }: FtrProviderContext) { | ||
const log = getService('log'); | ||
const config = getService('config'); | ||
const es = getService('es'); | ||
|
||
const reporter = CiStatsReporter.fromEnv(log); | ||
|
||
const { body: fields } = await es.fieldCaps({ | ||
index: '.kibana', | ||
fields: '*', | ||
}); | ||
const fieldCount = Object.keys(fields).length; | ||
log.debug('Saved Objects field count'); | ||
await reporter.metrics({ group: 'Saved Objects field count', id: 'total', value: fieldCount }); | ||
} |