kibana/test/examples/config.js
Tim Sullivan 160058a8c1
[search/public] expose showWarnings(inspector) method on search service (#138342)
* add showWarning to search service

* add comments

* add unit tests

* test foo

* cleanup

* add s to property name in test

* comments for api items

* use the warnings when calling showWarnings

* change showWarning to just show a single warning

* put handleWarnings on the request adapter

* comment

* simplify 1

* fix lens unit test

* remove underscoring for unused variables

* revert inspector changes, extract the response warnings in the search service

* fix bug

* remove console.log

* re-apply typescript fixes to app test code

* declutter

* add test, improve comments

* fix some unexported public api items

* include rawResponse in the warning structure

* fix lint

* tweak clean up example app

* SearchResponseWarnings and SearchResponseWarningNotification

* fix export bug

* not include shardStats if there are no warnings

* Update src/plugins/data/common/search/types.ts

* simplify SearchResponseWarnings interface

* remove array copying

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* comments for api_docs

* simplify per feedback

* Pass callback to handleResponse in showWarnings

* export more public types

* update example to make possible to show shard failure

* pr cleanup

* eslint fix

* allow example app to not show default warnings

* move extractWarning and related types to inspector plugin

* wip functional test of example app

* fix test references

* finish functional test

* relocate extractWarnings back to search/fetch

* fix test

* remove need for isTimeout, isShardFailure

* ts fix

* improve test

* Change showWarnings to accept the RequestAdapter

* use showWarnings in vis_types/timeseries

* more tests

* use handle_warning name

* fix ts

* add reason field to SearchResponseWarning

* fix component snapshot

* update comments

* test cleanup

* fix test

* ensure notification appears only once

* fix and cleanup

* fix ts

* fix response.json bug

* use top-level type, and lower-level reason.type

* cleanup

* fix shard failure warning in tsvb per feedback

cc @flash1293

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2022-08-31 11:22:24 -07:00

72 lines
2.5 KiB
JavaScript

/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { resolve } from 'path';
import { services } from '../plugin_functional/services';
import fs from 'fs';
import { REPO_ROOT } from '@kbn/utils';
export default async function ({ readConfigFile }) {
const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js'));
// Find all folders in /examples and /x-pack/examples since we treat all them as plugin folder
const examplesFiles = fs.readdirSync(resolve(REPO_ROOT, 'examples'));
const examples = examplesFiles.filter((file) =>
fs.statSync(resolve(REPO_ROOT, 'examples', file)).isDirectory()
);
return {
rootTags: ['runOutsideOfCiGroups'],
testFiles: [
require.resolve('./hello_world'),
require.resolve('./embeddables'),
require.resolve('./bfetch_explorer'),
require.resolve('./ui_actions'),
require.resolve('./state_sync'),
require.resolve('./routing'),
require.resolve('./expressions_explorer'),
require.resolve('./data_view_field_editor_example'),
require.resolve('./field_formats'),
require.resolve('./partial_results'),
require.resolve('./search'),
],
services: {
...functionalConfig.get('services'),
...services,
},
uiSettings: {
defaults: {
'accessibility:disableAnimations': true,
'dateFormat:tz': 'UTC',
},
},
pageObjects: functionalConfig.get('pageObjects'),
servers: functionalConfig.get('servers'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
apps: functionalConfig.get('apps'),
screenshots: functionalConfig.get('screenshots'),
junit: {
reportName: 'Example plugin functional tests',
},
kbnTestServer: {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
...functionalConfig.get('kbnTestServer.serverArgs'),
// Required to load new platform plugins via `--plugin-path` flag.
'--env.name=development',
'--telemetry.optIn=false',
...examples.map(
(exampleDir) => `--plugin-path=${resolve(REPO_ROOT, 'examples', exampleDir)}`
),
],
},
};
}