Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[kbn/test] move types/ftr into src (elastic#99555)
Browse files Browse the repository at this point in the history
* [kbn/test] move types/ftr into src

* Apply eslint updates

* fix import of Lifecycle type

Co-authored-by: spalger <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	x-pack/test/functional_cors/config.ts
#	x-pack/test/reporting_functional/reporting_and_deprecated_security.config.ts
  • Loading branch information
Spencer authored and spalger committed May 17, 2021
1 parent cd0c153 commit 3d70d14
Show file tree
Hide file tree
Showing 151 changed files with 157 additions and 162 deletions.
5 changes: 5 additions & 0 deletions packages/elastic-eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ module.exports = {
to: '@kbn/tinymath',
disallowedMessage: `Don't use 'tinymath', use '@kbn/tinymath'`
},
{
from: '@kbn/test/types/ftr',
to: '@kbn/test',
disallowedMessage: `import from the root of @kbn/test instead`
},
],
],
},
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/types/index.d.ts",
"main": "./target",
"types": "./target/types",
"scripts": {
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --source-maps",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-test/src/functional_test_runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export { FunctionalTestRunner } from './functional_test_runner';
export { readConfigFile, Config } from './lib';
export { runFtrCli } from './cli';
export * from './lib/docker_servers';
export * from './public_types';
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
*/

import { ToolingLog } from '@kbn/dev-utils';
import {
Config,
Lifecycle,
FailureMetadata,
DockerServersService,
} from '../src/functional_test_runner/lib';
import { Test, Suite } from '../src/functional_test_runner/fake_mocha_types';

import { Config, Lifecycle, FailureMetadata, DockerServersService } from './lib';
import { Test, Suite } from './fake_mocha_types';

export { Lifecycle, Config, FailureMetadata };

Expand Down
4 changes: 1 addition & 3 deletions packages/kbn-test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-test/src",
"sourceRoot": "../../../../../../packages/kbn-test/src",
"types": [
"jest",
"node"
],
},
"include": [
"types/**/*",
"src/**/*",
"index.d.ts"
],
"exclude": [
"types/ftr_globals/**/*",
"**/__fixtures__/**/*"
]
}
5 changes: 0 additions & 5 deletions packages/kbn-test/types/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
import { pageObjects } from './page_objects';

Expand Down
2 changes: 1 addition & 1 deletion test/accessibility/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { pageObjects } from './page_objects';
import { services } from './services';
Expand Down
2 changes: 1 addition & 1 deletion test/api_integration/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

Expand Down
2 changes: 1 addition & 1 deletion test/common/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/discover/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';
import { services } from '../../services';
import { pageObjects } from '../../page_objects';

Expand Down
2 changes: 1 addition & 1 deletion test/functional/config.legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

// eslint-disable-next-line import/no-default-export
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { pageObjects } from './page_objects';
import { services } from './services';
Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/common/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { cloneDeepWith } from 'lodash';
import { Key, Origin } from 'selenium-webdriver';
// @ts-ignore internal modules are not typed
import { LegacyActionSequence } from 'selenium-webdriver/lib/actions';
import { ProvidedType } from '@kbn/test/types/ftr';
import { ProvidedType } from '@kbn/test';
import { modifyUrl } from '@kbn/std';

import Jimp from 'jimp';
Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/common/test_subjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import testSubjSelector from '@kbn/test-subj-selector';
import { map as mapAsync } from 'bluebird';
import { ProvidedType } from '@kbn/test/types/ftr';
import { ProvidedType } from '@kbn/test';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';

Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/remote/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Fs from 'fs';

import * as Rx from 'rxjs';
import { mergeMap, map, takeUntil, catchError } from 'rxjs/operators';
import { Lifecycle } from '@kbn/test/src/functional_test_runner/lib/lifecycle';
import { Lifecycle } from '@kbn/test';
import { ToolingLog } from '@kbn/dev-utils';
import chromeDriver from 'chromedriver';
// @ts-ignore types not available
Expand Down
2 changes: 1 addition & 1 deletion test/interpreter_functional/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import path from 'path';
import fs from 'fs';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../functional/config'));
Expand Down
2 changes: 1 addition & 1 deletion test/new_visualize_flow/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const commonConfig = await readConfigFile(require.resolve('../functional/config.js'));
Expand Down
2 changes: 1 addition & 1 deletion test/plugin_functional/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import path from 'path';
import fs from 'fs';

Expand Down
2 changes: 1 addition & 1 deletion test/security_functional/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import path from 'path';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../functional/config'));
Expand Down
2 changes: 1 addition & 1 deletion test/server_integration/http/platform/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

// eslint-disable-next-line import/no-default-export
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion test/server_integration/services/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';
import { services as kibanaCommonServices } from '../../common/services';
import { services as kibanaApiIntegrationServices } from '../../api_integration/services';

Expand Down
2 changes: 1 addition & 1 deletion test/ui_capabilities/newsfeed_err/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
// @ts-ignore untyped module
import getFunctionalConfig from '../../functional/config';

Expand Down
2 changes: 1 addition & 1 deletion test/visual_regression/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion test/visual_regression/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { pageObjects } from '../functional/page_objects';
import { services } from './services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { postSnapshot } from '@percy/agent/dist/utils/sdk-utils';
import testSubjSelector from '@kbn/test-subj-selector';
import { Test } from '@kbn/test/types/ftr';
import { Test } from '@kbn/test';
import { kibanaPackageJson as pkg } from '@kbn/utils';
import { FtrProviderContext } from '../../ftr_provider_context';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { resolve } from 'path';

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

import { CA_CERT_PATH } from '@kbn/dev-utils';
async function config({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress_open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { cypressOpenTests } from './cypress_start';

async function openE2ETests({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress_run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { cypressRunTests } from './cypress_start';

async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
import { pageObjects } from './page_objects';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/accessibility/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { pageObjects } from './page_objects';
import { services } from './services';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/alerting_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from 'path';
import getPort from 'get-port';
import fs from 'fs';
import { CA_CERT_PATH } from '@kbn/dev-utils';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
import { getAllExternalServiceSimulatorPaths } from './fixtures/plugins/actions_simulators/server/plugin';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';

export async function getApiIntegrationConfig({ readConfigFile }: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/config_security_basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* eslint-disable import/no-default-export */

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { default as createTestConfig } from './config';

export default async function (context: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/config_security_trial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* eslint-disable import/no-default-export */

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import { default as createTestConfig } from './config';

export default async function (context: FtrConfigProviderContext) {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/ftr_provider_context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration_basic/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xpackApiIntegrationConfig = await readConfigFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';

import { services } from '../api_integration/services';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/apm_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { FtrConfigProviderContext } from '@kbn/test';
import supertest from 'supertest';
import { format, UrlObject } from 'url';
import path from 'path';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { GenericFtrProviderContext } from '@kbn/test/types/ftr';
import { GenericFtrProviderContext } from '@kbn/test';
import { FtrProviderContext as InheritedFtrProviderContext } from '../../api_integration/ftr_provider_context';
import { ApmServices } from './config';

Expand Down
Loading

0 comments on commit 3d70d14

Please sign in to comment.