From 24fda7ed565652203eba3040c74b8b9be2171a8d Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Wed, 3 Mar 2021 22:15:41 +0000 Subject: [PATCH 1/4] [Rename] kbn-test in packages directory to osd-test/functional_test_runner Signed-off-by: Mihir Soni --- .../__tests__/fixtures/failure_hooks/config.js | 0 .../fixtures/failure_hooks/tests/after_hook.js | 0 .../fixtures/failure_hooks/tests/before_hook.js | 0 .../__tests__/fixtures/failure_hooks/tests/it.js | 0 .../__tests__/fixtures/simple_project/config.js | 0 .../__tests__/fixtures/simple_project/tests.js | 2 +- .../__tests__/integration/basic.js | 4 ++-- .../__tests__/integration/failure_hooks.js | 4 ++-- .../src/functional_test_runner/cli.ts | 12 ++++++------ .../functional_test_runner/fake_mocha_types.d.ts | 0 .../functional_test_runner.ts | 2 +- .../src/functional_test_runner/index.ts | 0 .../lib/config/__tests__/fixtures/config.1.js | 0 .../lib/config/__tests__/fixtures/config.2.js | 0 .../lib/config/__tests__/fixtures/config.3.js | 0 .../lib/config/__tests__/fixtures/config.4.js | 0 .../config/__tests__/fixtures/config.invalid.js | 0 .../lib/config/__tests__/read_config_file.js | 4 ++-- .../functional_test_runner/lib/config/config.ts | 0 .../functional_test_runner/lib/config/index.ts | 0 .../lib/config/read_config_file.ts | 2 +- .../functional_test_runner/lib/config/schema.ts | 16 ++++++++-------- .../lib/docker_servers/README.md | 2 +- .../lib/docker_servers/container_logs.ts | 2 +- .../lib/docker_servers/container_running.ts | 2 +- .../define_docker_servers_config.ts | 0 .../lib/docker_servers/docker_servers_service.ts | 2 +- .../lib/docker_servers/index.ts | 0 .../lib/failure_metadata.test.ts | 0 .../lib/failure_metadata.ts | 2 +- .../src/functional_test_runner/lib/index.ts | 0 .../src/functional_test_runner/lib/lifecycle.ts | 0 .../lib/lifecycle_event.ts | 0 .../lib/lifecycle_phase.test.ts | 0 .../lib/lifecycle_phase.ts | 0 .../functional_test_runner/lib/load_tracer.ts | 0 .../lib/mocha/assignment_proxy.js | 0 .../lib/mocha/decorate_mocha_ui.js | 2 +- .../lib/mocha/filter_suites_by_tags.js | 0 .../lib/mocha/filter_suites_by_tags.test.js | 0 .../functional_test_runner/lib/mocha/index.ts | 0 .../lib/mocha/load_test_files.js | 2 +- .../lib/mocha/reporter/colors.js | 0 .../lib/mocha/reporter/index.js | 0 .../lib/mocha/reporter/ms.js | 0 .../lib/mocha/reporter/reporter.js | 2 +- .../lib/mocha/reporter/symbols.js | 0 .../lib/mocha/reporter/write_epilogue.js | 0 .../lib/mocha/run_tests.ts | 0 .../lib/mocha/setup_mocha.js | 2 +- .../lib/mocha/wrap_function.js | 0 .../lib/mocha/wrap_runnable_args.js | 0 .../lib/providers/async_instance.ts | 0 .../lib/providers/index.ts | 0 .../lib/providers/provider_collection.ts | 2 +- .../lib/providers/read_provider_spec.ts | 0 .../lib/providers/verbose_instance.ts | 2 +- .../lib/suite_tracker.test.ts | 4 ++-- .../functional_test_runner/lib/suite_tracker.ts | 2 +- 59 files changed, 37 insertions(+), 37 deletions(-) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/failure_hooks/config.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/after_hook.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/before_hook.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/it.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/simple_project/config.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js (96%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/integration/basic.js (95%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/__tests__/integration/failure_hooks.js (97%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/cli.ts (91%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/fake_mocha_types.d.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/functional_test_runner.ts (99%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/fixtures/config.1.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/fixtures/config.2.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/fixtures/config.3.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/fixtures/config.4.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/fixtures/config.invalid.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/__tests__/read_config_file.js (96%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/config.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/read_config_file.ts (97%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/config/schema.ts (95%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/README.md (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/container_logs.ts (96%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/container_running.ts (97%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/define_docker_servers_config.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts (99%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/docker_servers/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/failure_metadata.test.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/failure_metadata.ts (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/lifecycle.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/lifecycle_event.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/lifecycle_phase.test.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/lifecycle_phase.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/load_tracer.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/assignment_proxy.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js (99%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/filter_suites_by_tags.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/load_test_files.js (96%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/colors.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/index.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/ms.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/reporter.js (99%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/symbols.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/reporter/write_epilogue.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/run_tests.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/setup_mocha.js (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/wrap_function.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/mocha/wrap_runnable_args.js (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/providers/async_instance.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/providers/index.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/providers/provider_collection.ts (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/providers/read_provider_spec.ts (100%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/providers/verbose_instance.ts (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/suite_tracker.test.ts (98%) rename packages/{kbn-test => osd-test}/src/functional_test_runner/lib/suite_tracker.ts (99%) diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/config.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/config.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/config.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/config.js diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/after_hook.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/after_hook.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/after_hook.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/after_hook.js diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/before_hook.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/before_hook.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/before_hook.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/before_hook.js diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/it.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/it.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/it.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/failure_hooks/tests/it.js diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/simple_project/config.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/simple_project/config.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/simple_project/config.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/simple_project/config.js diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js similarity index 96% rename from packages/kbn-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js rename to packages/osd-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js index 02e49fefc58..471b1adec85 100644 --- a/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js +++ b/packages/osd-test/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from '@kbn/expect'; +import expect from '@osd/expect'; export default () => { describe('app one', () => { diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js b/packages/osd-test/src/functional_test_runner/__tests__/integration/basic.js similarity index 95% rename from packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js rename to packages/osd-test/src/functional_test_runner/__tests__/integration/basic.js index a010d9f0b03..c9c257bed85 100644 --- a/packages/kbn-test/src/functional_test_runner/__tests__/integration/basic.js +++ b/packages/osd-test/src/functional_test_runner/__tests__/integration/basic.js @@ -20,8 +20,8 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; -import expect from '@kbn/expect'; -import { REPO_ROOT } from '@kbn/utils'; +import expect from '@osd/expect'; +import { REPO_ROOT } from '@osd/utils'; const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js'); const BASIC_CONFIG = require.resolve('../fixtures/simple_project/config.js'); diff --git a/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js b/packages/osd-test/src/functional_test_runner/__tests__/integration/failure_hooks.js similarity index 97% rename from packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js rename to packages/osd-test/src/functional_test_runner/__tests__/integration/failure_hooks.js index fa4ef88fd3e..ab82ff75c26 100644 --- a/packages/kbn-test/src/functional_test_runner/__tests__/integration/failure_hooks.js +++ b/packages/osd-test/src/functional_test_runner/__tests__/integration/failure_hooks.js @@ -21,8 +21,8 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; import stripAnsi from 'strip-ansi'; -import expect from '@kbn/expect'; -import { REPO_ROOT } from '@kbn/utils'; +import expect from '@osd/expect'; +import { REPO_ROOT } from '@osd/utils'; const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js'); const FAILURE_HOOKS_CONFIG = require.resolve('../fixtures/failure_hooks/config.js'); diff --git a/packages/kbn-test/src/functional_test_runner/cli.ts b/packages/osd-test/src/functional_test_runner/cli.ts similarity index 91% rename from packages/kbn-test/src/functional_test_runner/cli.ts rename to packages/osd-test/src/functional_test_runner/cli.ts index 8a2075b2e7b..5f17d8d8e49 100644 --- a/packages/kbn-test/src/functional_test_runner/cli.ts +++ b/packages/osd-test/src/functional_test_runner/cli.ts @@ -20,7 +20,7 @@ import { resolve } from 'path'; import { inspect } from 'util'; -import { run, createFlagError, Flags } from '@kbn/dev-utils'; +import { run, createFlagError, Flags } from '@osd/dev-utils'; import exitHook from 'exit-hook'; import { FunctionalTestRunner } from './functional_test_runner'; @@ -28,10 +28,10 @@ import { FunctionalTestRunner } from './functional_test_runner'; const makeAbsolutePath = (v: string) => resolve(process.cwd(), v); const toArray = (v: string | string[]) => ([] as string[]).concat(v || []); const parseInstallDir = (flags: Flags) => { - const flag = flags['kibana-install-dir']; + const flag = flags['opensearch-dashboards-install-dir']; if (typeof flag !== 'string' && flag !== undefined) { - throw createFlagError('--kibana-install-dir must be a string or not defined'); + throw createFlagError('--opensearch-dashboards-install-dir must be a string or not defined'); } return flag ? makeAbsolutePath(flag) : undefined; @@ -49,7 +49,7 @@ export function runFtrCli() { grep: flags.grep || undefined, invert: flags.invert, }, - kbnTestServer: { + osdTestServer: { installDir: parseInstallDir(flags), }, suiteFiles: { @@ -116,7 +116,7 @@ export function runFtrCli() { 'exclude', 'include-tag', 'exclude-tag', - 'kibana-install-dir', + 'opensearch-dashboards-install-dir', ], boolean: ['bail', 'invert', 'test-stats', 'updateBaselines'], default: { @@ -133,7 +133,7 @@ export function runFtrCli() { --exclude-tag=tag a tag to be excluded, pass multiple times for multiple tags --test-stats print the number of tests (included and excluded) to STDERR --updateBaselines replace baseline screenshots with whatever is generated from the test - --kibana-install-dir directory where the Kibana install being tested resides + --opensearch-dashboards-install-dir directory where the OpenSearch Dashbaords install being tested resides `, }, } diff --git a/packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts b/packages/osd-test/src/functional_test_runner/fake_mocha_types.d.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts rename to packages/osd-test/src/functional_test_runner/fake_mocha_types.d.ts diff --git a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts b/packages/osd-test/src/functional_test_runner/functional_test_runner.ts similarity index 99% rename from packages/kbn-test/src/functional_test_runner/functional_test_runner.ts rename to packages/osd-test/src/functional_test_runner/functional_test_runner.ts index 24f5cdceac9..92edaf02664 100644 --- a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts +++ b/packages/osd-test/src/functional_test_runner/functional_test_runner.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { Suite, Test } from './fake_mocha_types'; import { diff --git a/packages/kbn-test/src/functional_test_runner/index.ts b/packages/osd-test/src/functional_test_runner/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/index.ts rename to packages/osd-test/src/functional_test_runner/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.1.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.1.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.1.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.1.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.2.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.2.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.2.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.2.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.3.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.3.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.3.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.3.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.4.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.4.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.4.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.4.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.invalid.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.invalid.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.invalid.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/config.invalid.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js similarity index 96% rename from packages/kbn-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js rename to packages/osd-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js index 8d02e726240..4f11b7a52e2 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js +++ b/packages/osd-test/src/functional_test_runner/lib/config/__tests__/read_config_file.js @@ -17,9 +17,9 @@ * under the License. */ -import expect from '@kbn/expect'; +import expect from '@osd/expect'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { readConfigFile } from '../read_config_file'; import { Config } from '../config'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/config.ts b/packages/osd-test/src/functional_test_runner/lib/config/config.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/config.ts rename to packages/osd-test/src/functional_test_runner/lib/config/config.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/index.ts b/packages/osd-test/src/functional_test_runner/lib/config/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/config/index.ts rename to packages/osd-test/src/functional_test_runner/lib/config/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/read_config_file.ts b/packages/osd-test/src/functional_test_runner/lib/config/read_config_file.ts similarity index 97% rename from packages/kbn-test/src/functional_test_runner/lib/config/read_config_file.ts rename to packages/osd-test/src/functional_test_runner/lib/config/read_config_file.ts index 2e40aeec4f4..6388df13838 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/read_config_file.ts +++ b/packages/osd-test/src/functional_test_runner/lib/config/read_config_file.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { defaultsDeep } from 'lodash'; import { Config } from './config'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts b/packages/osd-test/src/functional_test_runner/lib/config/schema.ts similarity index 95% rename from packages/kbn-test/src/functional_test_runner/lib/config/schema.ts rename to packages/osd-test/src/functional_test_runner/lib/config/schema.ts index 6ed114d62e2..9c093ef6b47 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts +++ b/packages/osd-test/src/functional_test_runner/lib/config/schema.ts @@ -105,8 +105,8 @@ export const schema = Joi.object() find: Joi.number().default(10000), try: Joi.number().default(120000), waitFor: Joi.number().default(20000), - esRequestTimeout: Joi.number().default(30000), - kibanaStabilize: Joi.number().default(15000), + opensearchRequestTimeout: Joi.number().default(30000), + opensearchDashboardsStabilize: Joi.number().default(15000), navigateStatusPageCheck: Joi.number().default(250), // Many of our tests use the `exists` functions to determine where the user is. For @@ -173,8 +173,8 @@ export const schema = Joi.object() servers: Joi.object() .keys({ - kibana: urlPartsSchema(), - elasticsearch: urlPartsSchema(), + opensearchDashboards: urlPartsSchema(), + opensearch: urlPartsSchema(), }) .default(), @@ -189,7 +189,7 @@ export const schema = Joi.object() }) .default(), - kbnTestServer: Joi.object() + osdTestServer: Joi.object() .keys({ buildArgs: Joi.array(), sourceArgs: Joi.array(), @@ -217,14 +217,14 @@ export const schema = Joi.object() // definition of apps that work with `common.navigateToApp()` apps: Joi.object().pattern(ID_PATTERN, appUrlPartsSchema()).default(), - // settings for the esArchiver module - esArchiver: Joi.object() + // settings for the opensearchArchiver module + opensearchArchiver: Joi.object() .keys({ directory: Joi.string().default(defaultRelativeToConfigPath('fixtures/es_archiver')), }) .default(), - // settings for the kibanaServer.uiSettings module + // settings for the opensearchDashboardsServer.uiSettings module uiSettings: Joi.object() .keys({ defaults: Joi.object().unknown(true), diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/README.md b/packages/osd-test/src/functional_test_runner/lib/docker_servers/README.md similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/README.md rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/README.md index d75faf4c854..1b132b378a2 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/README.md +++ b/packages/osd-test/src/functional_test_runner/lib/docker_servers/README.md @@ -6,7 +6,7 @@ To configure docker servers in your FTR config add the `dockerServers` key to yo ```ts // import this helper to get TypeScript support for this section of the config -import { defineDockerServersConfig } from '@kbn/test'; +import { defineDockerServersConfig } from '@osd/test'; export default function () { return { diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_logs.ts b/packages/osd-test/src/functional_test_runner/lib/docker_servers/container_logs.ts similarity index 96% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_logs.ts rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/container_logs.ts index f8e8137ce40..58fe6be8e5a 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_logs.ts +++ b/packages/osd-test/src/functional_test_runner/lib/docker_servers/container_logs.ts @@ -20,7 +20,7 @@ import execa from 'execa'; import * as Rx from 'rxjs'; import { tap } from 'rxjs/operators'; -import { ToolingLog, observeLines } from '@kbn/dev-utils'; +import { ToolingLog, observeLines } from '@osd/dev-utils'; /** * Observe the logs for a container, reflecting the log lines diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_running.ts b/packages/osd-test/src/functional_test_runner/lib/docker_servers/container_running.ts similarity index 97% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_running.ts rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/container_running.ts index 3e3247a6ae3..27169cf4cb2 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/container_running.ts +++ b/packages/osd-test/src/functional_test_runner/lib/docker_servers/container_running.ts @@ -19,7 +19,7 @@ import execa from 'execa'; import * as Rx from 'rxjs'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; /** * Create an observable that errors if a docker diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/define_docker_servers_config.ts b/packages/osd-test/src/functional_test_runner/lib/docker_servers/define_docker_servers_config.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/define_docker_servers_config.ts rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/define_docker_servers_config.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts b/packages/osd-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts similarity index 99% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts index e5bad88e5e7..fb6f5f4a68f 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts +++ b/packages/osd-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts @@ -21,7 +21,7 @@ import Url from 'url'; import execa from 'execa'; import * as Rx from 'rxjs'; import { filter, take, map } from 'rxjs/operators'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { Lifecycle } from '../lifecycle'; import { observeContainerRunning } from './container_running'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/docker_servers/index.ts b/packages/osd-test/src/functional_test_runner/lib/docker_servers/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/docker_servers/index.ts rename to packages/osd-test/src/functional_test_runner/lib/docker_servers/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts b/packages/osd-test/src/functional_test_runner/lib/failure_metadata.test.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts rename to packages/osd-test/src/functional_test_runner/lib/failure_metadata.test.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts b/packages/osd-test/src/functional_test_runner/lib/failure_metadata.ts similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts rename to packages/osd-test/src/functional_test_runner/lib/failure_metadata.ts index e5c60f1d208..d2378d40e93 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts +++ b/packages/osd-test/src/functional_test_runner/lib/failure_metadata.ts @@ -19,7 +19,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@osd/utils'; import { Lifecycle } from './lifecycle'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/index.ts b/packages/osd-test/src/functional_test_runner/lib/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/index.ts rename to packages/osd-test/src/functional_test_runner/lib/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts b/packages/osd-test/src/functional_test_runner/lib/lifecycle.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts rename to packages/osd-test/src/functional_test_runner/lib/lifecycle.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/lifecycle_event.ts b/packages/osd-test/src/functional_test_runner/lib/lifecycle_event.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/lifecycle_event.ts rename to packages/osd-test/src/functional_test_runner/lib/lifecycle_event.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/lifecycle_phase.test.ts b/packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.test.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/lifecycle_phase.test.ts rename to packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.test.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/lifecycle_phase.ts b/packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/lifecycle_phase.ts rename to packages/osd-test/src/functional_test_runner/lib/lifecycle_phase.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/load_tracer.ts b/packages/osd-test/src/functional_test_runner/lib/load_tracer.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/load_tracer.ts rename to packages/osd-test/src/functional_test_runner/lib/load_tracer.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/assignment_proxy.js b/packages/osd-test/src/functional_test_runner/lib/mocha/assignment_proxy.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/assignment_proxy.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/assignment_proxy.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js b/packages/osd-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js similarity index 99% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js index 92137a8c4f8..ea7ade67369 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js +++ b/packages/osd-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js @@ -17,7 +17,7 @@ * under the License. */ import { relative } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@osd/utils'; import { createAssignmentProxy } from './assignment_proxy'; import { wrapFunction } from './wrap_function'; import { wrapRunnableArgs } from './wrap_runnable_args'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.js b/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js b/packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/filter_suites_by_tags.test.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/index.ts b/packages/osd-test/src/functional_test_runner/lib/mocha/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/index.ts rename to packages/osd-test/src/functional_test_runner/lib/mocha/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_test_files.js b/packages/osd-test/src/functional_test_runner/lib/mocha/load_test_files.js similarity index 96% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/load_test_files.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/load_test_files.js index 5c23be63618..f629613ab38 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_test_files.js +++ b/packages/osd-test/src/functional_test_runner/lib/mocha/load_test_files.js @@ -41,7 +41,7 @@ export const loadTestFiles = ({ mocha, log, lifecycle, providers, paths, updateB log.verbose('Loading test file %s', path); const testModule = require(path); // eslint-disable-line import/no-dynamic-require - const testProvider = testModule.__esModule ? testModule.default : testModule; + const testProvider = testModule.__opensearchModule ? testModule.default : testModule; runTestProvider(testProvider, path); // eslint-disable-line }); diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/colors.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/colors.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/colors.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/colors.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/index.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/index.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/index.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/index.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ms.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/ms.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ms.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/ms.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/reporter.js similarity index 99% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/reporter.js index 9f89efddf49..6d4c10b984e 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js +++ b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/reporter.js @@ -20,7 +20,7 @@ import { format } from 'util'; import Mocha from 'mocha'; -import { ToolingLogTextWriter } from '@kbn/dev-utils'; +import { ToolingLogTextWriter } from '@osd/dev-utils'; import moment from 'moment'; import { setupJUnitReportGeneration } from '../../../../../../../src/dev'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/symbols.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/symbols.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/symbols.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/symbols.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/write_epilogue.js b/packages/osd-test/src/functional_test_runner/lib/mocha/reporter/write_epilogue.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/write_epilogue.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/reporter/write_epilogue.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/run_tests.ts b/packages/osd-test/src/functional_test_runner/lib/mocha/run_tests.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/run_tests.ts rename to packages/osd-test/src/functional_test_runner/lib/mocha/run_tests.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js b/packages/osd-test/src/functional_test_runner/lib/mocha/setup_mocha.js similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/setup_mocha.js index 39eb69a1519..66195ac2e22 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.js +++ b/packages/osd-test/src/functional_test_runner/lib/mocha/setup_mocha.js @@ -19,7 +19,7 @@ import Mocha from 'mocha'; import { relative } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@osd/utils'; import { loadTestFiles } from './load_test_files'; import { filterSuitesByTags } from './filter_suites_by_tags'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js b/packages/osd-test/src/functional_test_runner/lib/mocha/wrap_function.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/wrap_function.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_runnable_args.js b/packages/osd-test/src/functional_test_runner/lib/mocha/wrap_runnable_args.js similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_runnable_args.js rename to packages/osd-test/src/functional_test_runner/lib/mocha/wrap_runnable_args.js diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/async_instance.ts b/packages/osd-test/src/functional_test_runner/lib/providers/async_instance.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/providers/async_instance.ts rename to packages/osd-test/src/functional_test_runner/lib/providers/async_instance.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/index.ts b/packages/osd-test/src/functional_test_runner/lib/providers/index.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/providers/index.ts rename to packages/osd-test/src/functional_test_runner/lib/providers/index.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts b/packages/osd-test/src/functional_test_runner/lib/providers/provider_collection.ts similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts rename to packages/osd-test/src/functional_test_runner/lib/providers/provider_collection.ts index c58747e07dc..70b34b296a1 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts +++ b/packages/osd-test/src/functional_test_runner/lib/providers/provider_collection.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { loadTracer } from '../load_tracer'; import { createAsyncInstance, isAsyncInstance } from './async_instance'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts b/packages/osd-test/src/functional_test_runner/lib/providers/read_provider_spec.ts similarity index 100% rename from packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts rename to packages/osd-test/src/functional_test_runner/lib/providers/read_provider_spec.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/verbose_instance.ts b/packages/osd-test/src/functional_test_runner/lib/providers/verbose_instance.ts similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/providers/verbose_instance.ts rename to packages/osd-test/src/functional_test_runner/lib/providers/verbose_instance.ts index 1967e98306d..8207c75e941 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/providers/verbose_instance.ts +++ b/packages/osd-test/src/functional_test_runner/lib/providers/verbose_instance.ts @@ -19,7 +19,7 @@ import { inspect } from 'util'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; function printArgs(args: any[]): string { return args diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts similarity index 98% rename from packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts rename to packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts index 5350b270984..3554df658a1 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts +++ b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts @@ -21,11 +21,11 @@ import fs from 'fs'; import { join, resolve } from 'path'; jest.mock('fs'); -jest.mock('@kbn/utils', () => { +jest.mock('@osd/utils', () => { return { REPO_ROOT: '/dev/null/root' }; }); -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@osd/dev-utils'; import { Lifecycle } from './lifecycle'; import { SuiteTracker } from './suite_tracker'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.ts similarity index 99% rename from packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts rename to packages/osd-test/src/functional_test_runner/lib/suite_tracker.ts index 6cbd7446710..e6f9dc166f4 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts +++ b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.ts @@ -19,7 +19,7 @@ import fs from 'fs'; import { dirname, relative, resolve } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@osd/utils'; import { Lifecycle } from './lifecycle'; From 23e02080ddfff6ba77c6609ef4e3e97abbadac20 Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Wed, 3 Mar 2021 22:30:32 +0000 Subject: [PATCH 2/4] [Rename] kbn-test in packages directory to osd-test/functional_tests Signed-off-by: Mihir Soni --- .../functional_tests/lib/run_elasticsearch.js | 69 ------------------- .../src/functional_tests/cli/index.js | 0 .../run_tests/__snapshots__/args.test.js.snap | 0 .../run_tests/__snapshots__/cli.test.js.snap | 0 .../functional_tests/cli/run_tests/args.js | 22 +++--- .../cli/run_tests/args.test.js | 38 +++++----- .../src/functional_tests/cli/run_tests/cli.js | 0 .../cli/run_tests/cli.test.js | 20 +++--- .../__snapshots__/args.test.js.snap | 0 .../__snapshots__/cli.test.js.snap | 0 .../cli/start_servers/args.js | 22 +++--- .../cli/start_servers/args.test.js | 32 ++++----- .../functional_tests/cli/start_servers/cli.js | 0 .../cli/start_servers/cli.test.js | 16 ++--- .../lib/__snapshots__/run_cli.test.js.snap | 0 .../src/functional_tests/lib/auth.js | 20 +++--- .../lib/babel_register_for_test_plugins.js | 4 +- .../src/functional_tests/lib/index.js | 6 +- .../src/functional_tests/lib/paths.js | 12 ++-- .../src/functional_tests/lib/run_cli.js | 0 .../src/functional_tests/lib/run_cli.test.js | 0 .../src/functional_tests/lib/run_ftr.js | 2 +- .../functional_tests/lib/run_opensearch.js | 69 +++++++++++++++++++ .../lib/run_opensearch_dashboards_server.js} | 36 +++++----- .../src/functional_tests/tasks.js | 46 ++++++------- .../src/functional_tests/test_helpers.js | 0 26 files changed, 207 insertions(+), 207 deletions(-) delete mode 100644 packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js rename packages/{kbn-test => osd-test}/src/functional_tests/cli/index.js (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/__snapshots__/args.test.js.snap (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/__snapshots__/cli.test.js.snap (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/args.js (88%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/args.test.js (75%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/cli.js (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/run_tests/cli.test.js (88%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/__snapshots__/args.test.js.snap (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/__snapshots__/cli.test.js.snap (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/args.js (83%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/args.test.js (75%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/cli.js (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/cli/start_servers/cli.test.js (90%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/__snapshots__/run_cli.test.js.snap (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/auth.js (82%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/babel_register_for_test_plugins.js (92%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/index.js (77%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/paths.js (67%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/run_cli.js (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/run_cli.test.js (100%) rename packages/{kbn-test => osd-test}/src/functional_tests/lib/run_ftr.js (99%) create mode 100644 packages/osd-test/src/functional_tests/lib/run_opensearch.js rename packages/{kbn-test/src/functional_tests/lib/run_kibana_server.js => osd-test/src/functional_tests/lib/run_opensearch_dashboards_server.js} (73%) rename packages/{kbn-test => osd-test}/src/functional_tests/tasks.js (73%) rename packages/{kbn-test => osd-test}/src/functional_tests/test_helpers.js (100%) diff --git a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js deleted file mode 100644 index 3d174791fff..00000000000 --- a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { resolve } from 'path'; -import { KIBANA_ROOT } from './paths'; -import { createLegacyEsTestCluster } from '../../legacy_es'; - -import { setupUsers, DEFAULT_SUPERUSER_PASS } from './auth'; - -export async function runElasticsearch({ config, options }) { - const { log, esFrom } = options; - const ssl = config.get('esTestCluster.ssl'); - const license = config.get('esTestCluster.license'); - const esArgs = config.get('esTestCluster.serverArgs'); - const esEnvVars = config.get('esTestCluster.serverEnvVars'); - const isSecurityEnabled = esArgs.includes('xpack.security.enabled=true'); - - const cluster = createLegacyEsTestCluster({ - port: config.get('servers.elasticsearch.port'), - password: isSecurityEnabled - ? DEFAULT_SUPERUSER_PASS - : config.get('servers.elasticsearch.password'), - license, - log, - basePath: resolve(KIBANA_ROOT, '.es'), - esFrom: esFrom || config.get('esTestCluster.from'), - dataArchive: config.get('esTestCluster.dataArchive'), - esArgs, - esEnvVars, - ssl, - }); - - await cluster.start(); - - if (isSecurityEnabled) { - await setupUsers({ - log, - esPort: config.get('servers.elasticsearch.port'), - updates: [config.get('servers.elasticsearch'), config.get('servers.kibana')], - protocol: config.get('servers.elasticsearch').protocol, - caPath: getRelativeCertificateAuthorityPath(config.get('kbnTestServer.serverArgs')), - }); - } - - return cluster; -} - -function getRelativeCertificateAuthorityPath(esConfig = []) { - const caConfig = esConfig.find( - (config) => config.indexOf('--elasticsearch.ssl.certificateAuthorities') === 0 - ); - return caConfig ? caConfig.split('=')[1] : undefined; -} diff --git a/packages/kbn-test/src/functional_tests/cli/index.js b/packages/osd-test/src/functional_tests/cli/index.js similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/index.js rename to packages/osd-test/src/functional_tests/cli/index.js diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/__snapshots__/args.test.js.snap b/packages/osd-test/src/functional_tests/cli/run_tests/__snapshots__/args.test.js.snap similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/run_tests/__snapshots__/args.test.js.snap rename to packages/osd-test/src/functional_tests/cli/run_tests/__snapshots__/args.test.js.snap diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/__snapshots__/cli.test.js.snap b/packages/osd-test/src/functional_tests/cli/run_tests/__snapshots__/cli.test.js.snap similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/run_tests/__snapshots__/cli.test.js.snap rename to packages/osd-test/src/functional_tests/cli/run_tests/__snapshots__/cli.test.js.snap diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/args.js b/packages/osd-test/src/functional_tests/cli/run_tests/args.js similarity index 88% rename from packages/kbn-test/src/functional_tests/cli/run_tests/args.js rename to packages/osd-test/src/functional_tests/cli/run_tests/args.js index 94d510915d8..6b28e212813 100644 --- a/packages/kbn-test/src/functional_tests/cli/run_tests/args.js +++ b/packages/osd-test/src/functional_tests/cli/run_tests/args.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import dedent from 'dedent'; -import { ToolingLog, pickLevelFromFlags } from '@kbn/dev-utils'; +import { ToolingLog, pickLevelFromFlags } from '@osd/dev-utils'; const options = { help: { desc: 'Display this menu and exit.' }, @@ -28,15 +28,15 @@ const options = { arg: '', desc: 'Pass in a config. Can pass in multiple configs.', }, - esFrom: { + opensearchFrom: { arg: '', choices: ['snapshot', 'source'], desc: 'Build Elasticsearch from source or run from snapshot.', - defaultHelp: 'Default: $TEST_ES_FROM or snapshot', + defaultHelp: 'Default: $TEST_OPENSEARCH_FROM or snapshot', }, - 'kibana-install-dir': { + 'opensearch-dashboards-install-dir': { arg: '', - desc: 'Run Kibana from existing install directory instead of from source.', + desc: 'Run Opensearch Dashboards from existing install directory instead of from source.', }, bail: { desc: 'Stop the test run at the first failure.' }, grep: { @@ -114,13 +114,13 @@ export function processOptions(userOptions, defaultConfigPaths) { } } - if (!userOptions.esFrom) { - userOptions.esFrom = process.env.TEST_ES_FROM || 'snapshot'; + if (!userOptions.opensearchFrom) { + userOptions.opensearchFrom = process.env.TEST_OPENSEARCH_FROM || 'snapshot'; } - if (userOptions['kibana-install-dir']) { - userOptions.installDir = userOptions['kibana-install-dir']; - delete userOptions['kibana-install-dir']; + if (userOptions['opensearch-dashboards-install-dir']) { + userOptions.installDir = userOptions['opensearch-dashboards-install-dir']; + delete userOptions['opensearch-dashboards-install-dir']; } userOptions.suiteFiles = { @@ -151,7 +151,7 @@ export function processOptions(userOptions, defaultConfigPaths) { ...userOptions, configs: configs.map((c) => resolve(c)), createLogger, - extraKbnOpts: userOptions._, + extraOsdOpts: userOptions._, }; } diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/args.test.js b/packages/osd-test/src/functional_tests/cli/run_tests/args.test.js similarity index 75% rename from packages/kbn-test/src/functional_tests/cli/run_tests/args.test.js rename to packages/osd-test/src/functional_tests/cli/run_tests/args.test.js index 35e4cef5b3a..6b27dcfc356 100644 --- a/packages/kbn-test/src/functional_tests/cli/run_tests/args.test.js +++ b/packages/osd-test/src/functional_tests/cli/run_tests/args.test.js @@ -18,16 +18,16 @@ */ import { displayHelp, processOptions } from './args'; -import { createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { createAbsolutePathSerializer } from '@osd/dev-utils'; expect.addSnapshotSerializer(createAbsolutePathSerializer(process.cwd())); -const INITIAL_TEST_ES_FROM = process.env.TEST_ES_FROM; +const INITIAL_TEST_OPENSEARCH_FROM = process.env.TEST_OPENSEARCH_FROM; beforeEach(() => { - process.env.TEST_ES_FROM = 'snapshot'; + process.env.TEST_OPENSEARCH_FROM = 'snapshot'; }); afterEach(() => { - process.env.TEST_ES_FROM = INITIAL_TEST_ES_FROM; + process.env.TEST_OPENSEARCH_FROM = INITIAL_TEST_OPENSEARCH_FROM; }); describe('display help for run tests CLI', () => { @@ -60,15 +60,15 @@ describe('process options for run tests CLI', () => { }).toThrow('functional_tests: invalid argument [peanut] to option [bail]'); }); - it('accepts string value for kibana-install-dir', () => { - const options = processOptions({ 'kibana-install-dir': 'foo' }, ['foo']); + it('accepts string value for opensearch-dashboards-install-dir', () => { + const options = processOptions({ 'opensearch-dashboards-install-dir': 'foo' }, ['foo']); expect(options).toMatchSnapshot(); }); - it('rejects boolean value for kibana-install-dir', () => { + it('rejects boolean value for opensearch-dashboards-install-dir', () => { expect(() => { - processOptions({ 'kibana-install-dir': true }, ['foo']); - }).toThrow('functional_tests: invalid argument [true] to option [kibana-install-dir]'); + processOptions({ 'opensearch-dashboards-install-dir': true }, ['foo']); + }).toThrow('functional_tests: invalid argument [true] to option [opensearch-dashboards-install-dir]'); }); it('accepts boolean value for updateBaselines', () => { @@ -76,27 +76,27 @@ describe('process options for run tests CLI', () => { expect(options).toMatchSnapshot(); }); - it('accepts source value for esFrom', () => { - const options = processOptions({ esFrom: 'source' }, ['foo']); + it('accepts source value for opensearchFrom', () => { + const options = processOptions({ opensearchFrom: 'source' }, ['foo']); expect(options).toMatchSnapshot(); }); - it('accepts source value for $TEST_ES_FROM', () => { - process.env.TEST_ES_FROM = 'source'; + it('accepts source value for $TEST_OPENSEARCH_FROM', () => { + process.env.TEST_OPENSEARCH_FROM = 'source'; const options = processOptions({}, ['foo']); expect(options).toMatchSnapshot(); }); - it('prioritizes source flag over $TEST_ES_FROM', () => { - process.env.TEST_ES_FROM = 'source'; - const options = processOptions({ esFrom: 'snapshot' }, ['foo']); + it('prioritizes source flag over $TEST_OPENSEARCH_FROM', () => { + process.env.TEST_OPENSEARCH_FROM = 'source'; + const options = processOptions({ opensearchFrom: 'snapshot' }, ['foo']); expect(options).toMatchSnapshot(); }); - it('rejects non-enum value for esFrom', () => { + it('rejects non-enum value for opensearchFrom', () => { expect(() => { - processOptions({ esFrom: 'butter' }, ['foo']); - }).toThrow('functional_tests: invalid argument [butter] to option [esFrom]'); + processOptions({ opensearchFrom: 'butter' }, ['foo']); + }).toThrow('functional_tests: invalid argument [butter] to option [opensearchFrom]'); }); it('accepts value for grep', () => { diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/cli.js b/packages/osd-test/src/functional_tests/cli/run_tests/cli.js similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/run_tests/cli.js rename to packages/osd-test/src/functional_tests/cli/run_tests/cli.js diff --git a/packages/kbn-test/src/functional_tests/cli/run_tests/cli.test.js b/packages/osd-test/src/functional_tests/cli/run_tests/cli.test.js similarity index 88% rename from packages/kbn-test/src/functional_tests/cli/run_tests/cli.test.js rename to packages/osd-test/src/functional_tests/cli/run_tests/cli.test.js index 97b74a3b2b5..4606ba48316 100644 --- a/packages/kbn-test/src/functional_tests/cli/run_tests/cli.test.js +++ b/packages/osd-test/src/functional_tests/cli/run_tests/cli.test.js @@ -42,7 +42,7 @@ describe('run tests CLI', () => { cwd: jest.fn(), env: { ...originalObjects.process.env, - TEST_ES_FROM: 'snapshot', + TEST_OPENSEARCH_FROM: 'snapshot', }, }; @@ -60,7 +60,7 @@ describe('run tests CLI', () => { global.process.argv = [...argvMock]; global.process.env = { ...originalObjects.process.env, - TEST_ES_FROM: 'snapshot', + TEST_OPENSEARCH_FROM: 'snapshot', }; jest.resetAllMocks(); }); @@ -100,16 +100,16 @@ describe('run tests CLI', () => { checkMockConsoleLogSnapshot(logMock); }); - it('accepts string value for kibana-install-dir', async () => { - global.process.argv.push('--kibana-install-dir', 'foo'); + it('accepts string value for opensearch-dashboards-install-dir', async () => { + global.process.argv.push('--opensearch-dashboards-install-dir', 'foo'); await runTestsCli(['foo']); expect(exitMock).not.toHaveBeenCalled(); }); - it('rejects boolean value for kibana-install-dir', async () => { - global.process.argv.push('--kibana-install-dir'); + it('rejects boolean value for opensearch-dashboards-install-dir', async () => { + global.process.argv.push('--opensearch-dashboards-install-dir'); await runTestsCli(['foo']); @@ -125,16 +125,16 @@ describe('run tests CLI', () => { expect(exitMock).not.toHaveBeenCalledWith(); }); - it('accepts source value for esFrom', async () => { - global.process.argv.push('--esFrom', 'source'); + it('accepts source value for opensearchFrom', async () => { + global.process.argv.push('--opensearchFrom', 'source'); await runTestsCli(['foo']); expect(exitMock).not.toHaveBeenCalled(); }); - it('rejects non-enum value for esFrom', async () => { - global.process.argv.push('--esFrom', 'butter'); + it('rejects non-enum value for opensearchFrom', async () => { + global.process.argv.push('--opensearchFrom', 'butter'); await runTestsCli(['foo']); diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/__snapshots__/args.test.js.snap b/packages/osd-test/src/functional_tests/cli/start_servers/__snapshots__/args.test.js.snap similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/start_servers/__snapshots__/args.test.js.snap rename to packages/osd-test/src/functional_tests/cli/start_servers/__snapshots__/args.test.js.snap diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/__snapshots__/cli.test.js.snap b/packages/osd-test/src/functional_tests/cli/start_servers/__snapshots__/cli.test.js.snap similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/start_servers/__snapshots__/cli.test.js.snap rename to packages/osd-test/src/functional_tests/cli/start_servers/__snapshots__/cli.test.js.snap diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/args.js b/packages/osd-test/src/functional_tests/cli/start_servers/args.js similarity index 83% rename from packages/kbn-test/src/functional_tests/cli/start_servers/args.js rename to packages/osd-test/src/functional_tests/cli/start_servers/args.js index e604e86de8b..66be6eaa888 100644 --- a/packages/kbn-test/src/functional_tests/cli/start_servers/args.js +++ b/packages/osd-test/src/functional_tests/cli/start_servers/args.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import dedent from 'dedent'; -import { ToolingLog, pickLevelFromFlags } from '@kbn/dev-utils'; +import { ToolingLog, pickLevelFromFlags } from '@osd/dev-utils'; const options = { help: { desc: 'Display this menu and exit.' }, @@ -28,14 +28,14 @@ const options = { arg: '', desc: 'Pass in a config', }, - esFrom: { + opensearchFrom: { arg: '', desc: 'Build Elasticsearch from source, snapshot or path to existing install dir.', - defaultHelp: 'Default: $TEST_ES_FROM or snapshot', + defaultHelp: 'Default: $TEST_OPENSEARCH_FROM or snapshot', }, - 'kibana-install-dir': { + 'opensearch-dashboards-install-dir': { arg: '', - desc: 'Run Kibana from existing install directory instead of from source.', + desc: 'Run Opensearch Dashboards from existing install directory instead of from source.', }, verbose: { desc: 'Log everything.' }, debug: { desc: 'Run in debug mode.' }, @@ -81,13 +81,13 @@ export function processOptions(userOptions, defaultConfigPath) { throw new Error(`functional_tests_server: config is required`); } - if (!userOptions.esFrom) { - userOptions.esFrom = process.env.TEST_ES_FROM || 'snapshot'; + if (!userOptions.opensearchFrom) { + userOptions.opensearchFrom = process.env.TEST_OPENSEARCH_FROM || 'snapshot'; } - if (userOptions['kibana-install-dir']) { - userOptions.installDir = userOptions['kibana-install-dir']; - delete userOptions['kibana-install-dir']; + if (userOptions['opensearch-dashboards-install-dir']) { + userOptions.installDir = userOptions['opensearch-dashboards-install-dir']; + delete userOptions['opensearch-dashboards-install-dir']; } function createLogger() { @@ -101,7 +101,7 @@ export function processOptions(userOptions, defaultConfigPath) { ...userOptions, config: resolve(config), createLogger, - extraKbnOpts: userOptions._, + extraOsdOpts: userOptions._, }; } diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/args.test.js b/packages/osd-test/src/functional_tests/cli/start_servers/args.test.js similarity index 75% rename from packages/kbn-test/src/functional_tests/cli/start_servers/args.test.js rename to packages/osd-test/src/functional_tests/cli/start_servers/args.test.js index 0c842c8c7df..d257f9572c3 100644 --- a/packages/kbn-test/src/functional_tests/cli/start_servers/args.test.js +++ b/packages/osd-test/src/functional_tests/cli/start_servers/args.test.js @@ -18,16 +18,16 @@ */ import { displayHelp, processOptions } from './args'; -import { createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { createAbsolutePathSerializer } from '@osd/dev-utils'; expect.addSnapshotSerializer(createAbsolutePathSerializer(process.cwd())); -const INITIAL_TEST_ES_FROM = process.env.TEST_ES_FROM; +const INITIAL_TEST_OPENSEARCH_FROM = process.env.TEST_OPENSEARCH_FROM; beforeEach(() => { - process.env.TEST_ES_FROM = 'snapshot'; + process.env.TEST_OPENSEARCH_FROM = 'snapshot'; }); afterEach(() => { - process.env.TEST_ES_FROM = INITIAL_TEST_ES_FROM; + process.env.TEST_OPENSEARCH_FROM = INITIAL_TEST_OPENSEARCH_FROM; }); describe('display help for start servers CLI', () => { @@ -60,31 +60,31 @@ describe('process options for start servers CLI', () => { }).toThrow('functional_tests_server: invalid option [bail]'); }); - it('accepts string value for kibana-install-dir', () => { - const options = processOptions({ 'kibana-install-dir': 'foo' }, 'foo'); + it('accepts string value for opensearch-dashboards-install-dir', () => { + const options = processOptions({ 'opensearch-dashboards-install-dir': 'foo' }, 'foo'); expect(options).toMatchSnapshot(); }); - it('rejects boolean value for kibana-install-dir', () => { + it('rejects boolean value for opensearch-dashboards-install-dir', () => { expect(() => { - processOptions({ 'kibana-install-dir': true }, 'foo'); - }).toThrow('functional_tests_server: invalid argument [true] to option [kibana-install-dir]'); + processOptions({ 'opensearch-dashboards-install-dir': true }, 'foo'); + }).toThrow('functional_tests_server: invalid argument [true] to option [opensearch-dashboards-install-dir]'); }); - it('accepts source value for esFrom', () => { - const options = processOptions({ esFrom: 'source' }, 'foo'); + it('accepts source value for opensearchFrom', () => { + const options = processOptions({ opensearchFrom: 'source' }, 'foo'); expect(options).toMatchSnapshot(); }); - it('accepts source value for $TEST_ES_FROM', () => { - process.env.TEST_ES_FROM = 'source'; + it('accepts source value for $TEST_OPENSEARCH_FROM', () => { + process.env.TEST_OPENSEARCH_FROM = 'source'; const options = processOptions({}, 'foo'); expect(options).toMatchSnapshot(); }); - it('prioritizes source flag over $TEST_ES_FROM', () => { - process.env.TEST_ES_FROM = 'source'; - const options = processOptions({ esFrom: 'snapshot' }, 'foo'); + it('prioritizes source flag over $TEST_OPENSEARCH_FROM', () => { + process.env.TEST_OPENSEARCH_FROM = 'source'; + const options = processOptions({ opensearchFrom: 'snapshot' }, 'foo'); expect(options).toMatchSnapshot(); }); diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/cli.js b/packages/osd-test/src/functional_tests/cli/start_servers/cli.js similarity index 100% rename from packages/kbn-test/src/functional_tests/cli/start_servers/cli.js rename to packages/osd-test/src/functional_tests/cli/start_servers/cli.js diff --git a/packages/kbn-test/src/functional_tests/cli/start_servers/cli.test.js b/packages/osd-test/src/functional_tests/cli/start_servers/cli.test.js similarity index 90% rename from packages/kbn-test/src/functional_tests/cli/start_servers/cli.test.js rename to packages/osd-test/src/functional_tests/cli/start_servers/cli.test.js index 3ceecb28066..6331c6de203 100644 --- a/packages/kbn-test/src/functional_tests/cli/start_servers/cli.test.js +++ b/packages/osd-test/src/functional_tests/cli/start_servers/cli.test.js @@ -42,7 +42,7 @@ describe('start servers CLI', () => { cwd: jest.fn(), env: { ...originalObjects.process.env, - TEST_ES_FROM: 'snapshot', + TEST_OPENSEARCH_FROM: 'snapshot', }, }; @@ -60,7 +60,7 @@ describe('start servers CLI', () => { global.process.argv = [...argvMock]; global.process.env = { ...originalObjects.process.env, - TEST_ES_FROM: 'snapshot', + TEST_OPENSEARCH_FROM: 'snapshot', }; jest.resetAllMocks(); }); @@ -100,16 +100,16 @@ describe('start servers CLI', () => { checkMockConsoleLogSnapshot(logMock); }); - it('accepts string value for kibana-install-dir', async () => { - global.process.argv.push('--kibana-install-dir', 'foo'); + it('accepts string value for opensearch-dashboards-install-dir', async () => { + global.process.argv.push('--opensearch-dashboards-install-dir', 'foo'); await startServersCli('foo'); expect(exitMock).not.toHaveBeenCalled(); }); - it('rejects boolean value for kibana-install-dir', async () => { - global.process.argv.push('--kibana-install-dir'); + it('rejects boolean value for opensearch-dashboards-install-dir', async () => { + global.process.argv.push('--opensearch-dashboards-install-dir'); await startServersCli('foo'); @@ -126,8 +126,8 @@ describe('start servers CLI', () => { checkMockConsoleLogSnapshot(logMock); }); - it('accepts source value for esFrom', async () => { - global.process.argv.push('--esFrom', 'source'); + it('accepts source value for opensearchFrom', async () => { + global.process.argv.push('--opensearchFrom', 'source'); await startServersCli('foo'); diff --git a/packages/kbn-test/src/functional_tests/lib/__snapshots__/run_cli.test.js.snap b/packages/osd-test/src/functional_tests/lib/__snapshots__/run_cli.test.js.snap similarity index 100% rename from packages/kbn-test/src/functional_tests/lib/__snapshots__/run_cli.test.js.snap rename to packages/osd-test/src/functional_tests/lib/__snapshots__/run_cli.test.js.snap diff --git a/packages/kbn-test/src/functional_tests/lib/auth.js b/packages/osd-test/src/functional_tests/lib/auth.js similarity index 82% rename from packages/kbn-test/src/functional_tests/lib/auth.js rename to packages/osd-test/src/functional_tests/lib/auth.js index 358b16c562b..4677c0c14b4 100644 --- a/packages/kbn-test/src/functional_tests/lib/auth.js +++ b/packages/osd-test/src/functional_tests/lib/auth.js @@ -1,8 +1,8 @@ /* - * Licensed to Elasticsearch B.V. under one or more contributor + * Licensed to opensearchsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under + * ownership. opensearchsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -82,26 +82,26 @@ async function updateCredentials({ throw new Error(`${statusCode} response, expected 200 -- ${JSON.stringify(body)}`); } -export async function setupUsers({ log, esPort, updates, protocol = 'http', caPath }) { - // track the current credentials for the `elastic` user as +export async function setupUsers({ log, opensearchPort, updates, protocol = 'http', caPath }) { + // track the current credentials for the `opensearch` user as // they will likely change as we apply updates - let auth = `elastic:${DEFAULT_SUPERUSER_PASS}`; + let auth = `opensearch:${DEFAULT_SUPERUSER_PASS}`; const caCert = caPath && (await readFile(caPath)); for (const { username, password, roles } of updates) { // If working with a built-in user, just change the password - if (['logstash_system', 'elastic', 'kibana'].includes(username)) { - await updateCredentials({ port: esPort, auth, username, password, protocol, caCert }); + if (['logstash_system', 'opensearch', 'opensearchDashboards'].includes(username)) { + await updateCredentials({ port: opensearchPort, auth, username, password, protocol, caCert }); log.info('setting %j user password to %j', username, password); // If not a builtin user, add them } else { - await insertUser({ port: esPort, auth, username, password, roles, protocol, caCert }); + await insertUser({ port: opensearchPort, auth, username, password, roles, protocol, caCert }); log.info('Added %j user with password to %j', username, password); } - if (username === 'elastic') { - auth = `elastic:${password}`; + if (username === 'opensearch') { + auth = `opensearch:${password}`; } } } diff --git a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js b/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js similarity index 92% rename from packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js rename to packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js index 44ff579411b..a66cdeba492 100644 --- a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js +++ b/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js @@ -19,7 +19,7 @@ const Path = require('path'); -const { REPO_ROOT } = require('@kbn/dev-utils'); +const { REPO_ROOT } = require('@osd/dev-utils'); // modifies all future calls to require() to automatically // compile the required source with babel @@ -34,6 +34,6 @@ require('@babel/register')({ Path.resolve(REPO_ROOT, 'x-pack/plugins/task_manager/server/config.ts'), ], babelrc: false, - presets: [require.resolve('@kbn/babel-preset/node_preset')], + presets: [require.resolve('@osd/babel-preset/node_preset')], extensions: ['.js', '.ts', '.tsx'], }); diff --git a/packages/kbn-test/src/functional_tests/lib/index.js b/packages/osd-test/src/functional_tests/lib/index.js similarity index 77% rename from packages/kbn-test/src/functional_tests/lib/index.js rename to packages/osd-test/src/functional_tests/lib/index.js index ec381b56b06..096034f31a1 100644 --- a/packages/kbn-test/src/functional_tests/lib/index.js +++ b/packages/osd-test/src/functional_tests/lib/index.js @@ -17,8 +17,8 @@ * under the License. */ -export { runKibanaServer } from './run_kibana_server'; -export { runElasticsearch } from './run_elasticsearch'; +export { runOpenSearchDashboardsServer } from './run_opensearch_dashboards_server'; +export { runOpenSearch } from './run_opensearch'; export { runFtr, hasTests, assertNoneExcluded } from './run_ftr'; -export { KIBANA_ROOT, KIBANA_FTR_SCRIPT, FUNCTIONAL_CONFIG_PATH, API_CONFIG_PATH } from './paths'; +export { OPENSEARCH_DASHBOARDS_ROOT, OPENSEARCH_DASHBOARDS_FTR_SCRIPT, FUNCTIONAL_CONFIG_PATH, API_CONFIG_PATH } from './paths'; export { runCli } from './run_cli'; diff --git a/packages/kbn-test/src/functional_tests/lib/paths.js b/packages/osd-test/src/functional_tests/lib/paths.js similarity index 67% rename from packages/kbn-test/src/functional_tests/lib/paths.js rename to packages/osd-test/src/functional_tests/lib/paths.js index 9ede5a105b0..a83dc635bcd 100644 --- a/packages/kbn-test/src/functional_tests/lib/paths.js +++ b/packages/osd-test/src/functional_tests/lib/paths.js @@ -25,10 +25,10 @@ function resolveRelative(path) { return relative(process.cwd(), resolve(path)); } -export const KIBANA_EXEC = 'node'; -export const KIBANA_EXEC_PATH = resolveRelative('scripts/kibana'); -export const KIBANA_ROOT = resolve(__dirname, '../../../../../'); -export const KIBANA_FTR_SCRIPT = resolve(KIBANA_ROOT, 'scripts/functional_test_runner'); +export const OPENSEARCH_DASHBOARDS_EXEC = 'node'; +export const OPENSEARCH_DASHBOARDS_EXEC_PATH = resolveRelative('scripts/opensearch_dashboards'); +export const OPENSEARCH_DASHBOARDS_ROOT = resolve(__dirname, '../../../../../'); +export const OPENSEARCH_DASHBOARDS_FTR_SCRIPT = resolve(OPENSEARCH_DASHBOARDS_ROOT, 'scripts/functional_test_runner'); export const PROJECT_ROOT = resolve(__dirname, '../../../../../../'); -export const FUNCTIONAL_CONFIG_PATH = resolve(KIBANA_ROOT, 'test/functional/config'); -export const API_CONFIG_PATH = resolve(KIBANA_ROOT, 'test/api_integration/config'); +export const FUNCTIONAL_CONFIG_PATH = resolve(OPENSEARCH_DASHBOARDS_ROOT, 'test/functional/config'); +export const API_CONFIG_PATH = resolve(OPENSEARCH_DASHBOARDS_ROOT, 'test/api_integration/config'); diff --git a/packages/kbn-test/src/functional_tests/lib/run_cli.js b/packages/osd-test/src/functional_tests/lib/run_cli.js similarity index 100% rename from packages/kbn-test/src/functional_tests/lib/run_cli.js rename to packages/osd-test/src/functional_tests/lib/run_cli.js diff --git a/packages/kbn-test/src/functional_tests/lib/run_cli.test.js b/packages/osd-test/src/functional_tests/lib/run_cli.test.js similarity index 100% rename from packages/kbn-test/src/functional_tests/lib/run_cli.test.js rename to packages/osd-test/src/functional_tests/lib/run_cli.test.js diff --git a/packages/kbn-test/src/functional_tests/lib/run_ftr.js b/packages/osd-test/src/functional_tests/lib/run_ftr.js similarity index 99% rename from packages/kbn-test/src/functional_tests/lib/run_ftr.js rename to packages/osd-test/src/functional_tests/lib/run_ftr.js index 14883ac977c..bf49b78ed71 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_ftr.js +++ b/packages/osd-test/src/functional_tests/lib/run_ftr.js @@ -33,7 +33,7 @@ async function createFtr({ bail: !!bail, grep, }, - kbnTestServer: { + osdTestServer: { installDir, }, updateBaselines, diff --git a/packages/osd-test/src/functional_tests/lib/run_opensearch.js b/packages/osd-test/src/functional_tests/lib/run_opensearch.js new file mode 100644 index 00000000000..ed64b018899 --- /dev/null +++ b/packages/osd-test/src/functional_tests/lib/run_opensearch.js @@ -0,0 +1,69 @@ +/* + * Licensed to opensearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. opensearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { resolve } from 'path'; +import { OPENSEARCH_DASHBOARDS_ROOT } from './paths'; +import { createLegacyOpenSearchTestCluster } from '../../legacy_opensearch'; + +import { setupUsers, DEFAULT_SUPERUSER_PASS } from './auth'; + +export async function runOpenSearch({ config, options }) { + const { log, opensearchFrom } = options; + const ssl = config.get('opensearchTestCluster.ssl'); + const license = config.get('opensearchTestCluster.license'); + const opensearchArgs = config.get('opensearchTestCluster.serverArgs'); + const opensearchEnvVars = config.get('opensearchTestCluster.serverEnvVars'); + const isSecurityEnabled = opensearchArgs.includes('xpack.security.enabled=true'); + + const cluster = createLegacyOpenSearchTestCluster({ + port: config.get('servers.opensearch.port'), + password: isSecurityEnabled + ? DEFAULT_SUPERUSER_PASS + : config.get('servers.opensearch.password'), + license, + log, + basePath: resolve(OPENSEARCH_DASHBOARDS_ROOT, '.opensearch'), + opensearchFrom: opensearchFrom || config.get('opensearchTestCluster.from'), + dataArchive: config.get('opensearchTestCluster.dataArchive'), + opensearchArgs, + opensearchEnvVars, + ssl, + }); + + await cluster.start(); + + if (isSecurityEnabled) { + await setupUsers({ + log, + opensearchPort: config.get('servers.opensearch.port'), + updates: [config.get('servers.opensearch'), config.get('servers.opensearchDashboards')], + protocol: config.get('servers.opensearch').protocol, + caPath: getRelativeCertificateAuthorityPath(config.get('osdTestServer.serverArgs')), + }); + } + + return cluster; +} + +function getRelativeCertificateAuthorityPath(esConfig = []) { + const caConfig = esConfig.find( + (config) => config.indexOf('--opensearch.ssl.certificateAuthorities') === 0 + ); + return caConfig ? caConfig.split('=')[1] : undefined; +} diff --git a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js b/packages/osd-test/src/functional_tests/lib/run_opensearch_dashboards_server.js similarity index 73% rename from packages/kbn-test/src/functional_tests/lib/run_kibana_server.js rename to packages/osd-test/src/functional_tests/lib/run_opensearch_dashboards_server.js index e7ec99467ec..c4570978776 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js +++ b/packages/osd-test/src/functional_tests/lib/run_opensearch_dashboards_server.js @@ -18,7 +18,7 @@ */ import { resolve, relative } from 'path'; -import { KIBANA_ROOT, KIBANA_EXEC, KIBANA_EXEC_PATH } from './paths'; +import { OPENSEARCH_DASHBOARDS_ROOT, OPENSEARCH_DASHBOARDS_EXEC, OPENSEARCH_DASHBOARDS_EXEC_PATH } from './paths'; function extendNodeOptions(installDir) { if (!installDir) { @@ -37,48 +37,48 @@ function extendNodeOptions(installDir) { }; } -export async function runKibanaServer({ procs, config, options }) { +export async function runOpenSearchDashboardsServer({ procs, config, options }) { const { installDir } = options; - await procs.run('kibana', { - cmd: getKibanaCmd(installDir), + await procs.run('opensearch-dashboards', { + cmd: getOpenSearchDashboardsCmd(installDir), args: filterCliArgs(collectCliArgs(config, options)), env: { FORCE_COLOR: 1, ...process.env, ...extendNodeOptions(installDir), }, - cwd: installDir || KIBANA_ROOT, + cwd: installDir || OPENSEARCH_DASHBOARDS_ROOT, wait: /http server running/, }); } -function getKibanaCmd(installDir) { +function getOpenSearchDashboardsCmd(installDir) { if (installDir) { return process.platform.startsWith('win') - ? resolve(installDir, 'bin/kibana.bat') - : resolve(installDir, 'bin/kibana'); + ? resolve(installDir, 'bin/opensearch_dashboards.bat') + : resolve(installDir, 'bin/opensearch_dashboards'); } - return KIBANA_EXEC; + return OPENSEARCH_DASHBOARDS_EXEC; } /** - * When installDir is passed, we run from a built version of Kibana, + * When installDir is passed, we run from a built version of Opensearch Dashboards, * which uses different command line arguments. If installDir is not * passed, we run from source code. We also allow passing in extra - * Kibana server options, so we tack those on here. + * Opensearch Dashboards server options, so we tack those on here. */ -function collectCliArgs(config, { installDir, extraKbnOpts }) { - const buildArgs = config.get('kbnTestServer.buildArgs') || []; - const sourceArgs = config.get('kbnTestServer.sourceArgs') || []; - const serverArgs = config.get('kbnTestServer.serverArgs') || []; +function collectCliArgs(config, { installDir, extraOsdOpts }) { + const buildArgs = config.get('osdTestServer.buildArgs') || []; + const sourceArgs = config.get('osdTestServer.sourceArgs') || []; + const serverArgs = config.get('osdTestServer.serverArgs') || []; return pipe( serverArgs, (args) => (installDir ? args.filter((a) => a !== '--oss') : args), - (args) => (installDir ? [...buildArgs, ...args] : [KIBANA_EXEC_PATH, ...sourceArgs, ...args]), - (args) => args.concat(extraKbnOpts || []) + (args) => (installDir ? [...buildArgs, ...args] : [OPENSEARCH_DASHBOARDS_EXEC_PATH, ...sourceArgs, ...args]), + (args) => args.concat(extraOsdOpts || []) ); } @@ -119,7 +119,7 @@ function pipe(arr, ...fns) { /** * Checks whether a specific parameter is allowed to appear multiple - * times in the Kibana parameters. + * times in the Opensearch Dashboards parameters. */ function allowsDuplicate(val) { return ['--plugin-path'].includes(val.split('=')[0]); diff --git a/packages/kbn-test/src/functional_tests/tasks.js b/packages/osd-test/src/functional_tests/tasks.js similarity index 73% rename from packages/kbn-test/src/functional_tests/tasks.js rename to packages/osd-test/src/functional_tests/tasks.js index 7d4fc84d47b..20841c7ecef 100644 --- a/packages/kbn-test/src/functional_tests/tasks.js +++ b/packages/osd-test/src/functional_tests/tasks.js @@ -20,30 +20,30 @@ import { relative } from 'path'; import * as Rx from 'rxjs'; import { startWith, switchMap, take } from 'rxjs/operators'; -import { withProcRunner } from '@kbn/dev-utils'; +import { withProcRunner } from '@osd/dev-utils'; import dedent from 'dedent'; import { runElasticsearch, - runKibanaServer, + runOpenSearchDashboardsServer, runFtr, assertNoneExcluded, hasTests, - KIBANA_FTR_SCRIPT, + OPENSEARCH_DASHBOARDS_FTR_SCRIPT, } from './lib'; import { readConfigFile } from '../functional_test_runner/lib'; const makeSuccessMessage = (options) => { - const installDirFlag = options.installDir ? ` --kibana-install-dir=${options.installDir}` : ''; + const installDirFlag = options.installDir ? ` --opensearch-dashboards-install-dir=${options.installDir}` : ''; return ( '\n\n' + dedent` - Elasticsearch and Kibana are ready for functional testing. Start the functional tests + Elasticsearch and Opensearch Dashboards are ready for functional testing. Start the functional tests in another terminal session by running this command from this directory: - node ${relative(process.cwd(), KIBANA_FTR_SCRIPT)}${installDirFlag} + node ${relative(process.cwd(), OPENSEARCH_DASHBOARDS_FTR_SCRIPT)}${installDirFlag} ` + '\n\n' ); @@ -54,18 +54,18 @@ const makeSuccessMessage = (options) => { * @param {object} options Optional * @property {string[]} options.configs Array of paths to configs * @property {function} options.log An instance of the ToolingLog - * @property {string} options.installDir Optional installation dir from which to run Kibana + * @property {string} options.installDir Optional installation dir from which to run Opensearch Dashboards * @property {boolean} options.bail Whether to exit test run at the first failure - * @property {string} options.esFrom Optionally run from source instead of snapshot + * @property {string} options.opensearchFrom Optionally run from source instead of snapshot */ export async function runTests(options) { - if (!process.env.KBN_NP_PLUGINS_BUILT) { + if (!process.env.OSD_NP_PLUGINS_BUILT) { const log = options.createLogger(); log.warning('❗️❗️❗️'); log.warning('❗️❗️❗️'); log.warning('❗️❗️❗️'); log.warning( - " Don't forget to use `node scripts/build_kibana_platform_plugins` to build plugins you plan on testing" + " Don't forget to use `node scripts/build_opensearch_dashboards_platform_plugins` to build plugins you plan on testing" ); log.warning('❗️❗️❗️'); log.warning('❗️❗️❗️'); @@ -95,17 +95,17 @@ export async function runTests(options) { await withProcRunner(log, async (procs) => { const config = await readConfigFile(log, configPath); - let es; + let opensearch; try { - es = await runElasticsearch({ config, options: opts }); - await runKibanaServer({ procs, config, options: opts }); + opensearch = await runElasticsearch({ config, options: opts }); + await runOpenSearchDashboardsServer({ procs, config, options: opts }); await runFtr({ configPath, options: opts }); } finally { try { - await procs.stop('kibana'); + await procs.stop('opensearch-dashboards'); } finally { - if (es) { - await es.cleanup(); + if (opensearch) { + await opensearch.cleanup(); } } } @@ -118,8 +118,8 @@ export async function runTests(options) { * @param {object} options Optional * @property {string} options.config Path to a config file * @property {function} options.log An instance of the ToolingLog - * @property {string} options.installDir Optional installation dir from which to run Kibana - * @property {string} options.esFrom Optionally run from source instead of snapshot + * @property {string} options.installDir Optional installation dir from which to run Opensearch Dashboards + * @property {string} options.opensearchFrom Optionally run from source instead of snapshot */ export async function startServers(options) { const log = options.createLogger(); @@ -131,14 +131,14 @@ export async function startServers(options) { await withProcRunner(log, async (procs) => { const config = await readConfigFile(log, options.config); - const es = await runElasticsearch({ config, options: opts }); - await runKibanaServer({ + const opensearch = await runElasticsearch({ config, options: opts }); + await runOpenSearchDashboardsServer({ procs, config, options: { ...opts, - extraKbnOpts: [ - ...options.extraKbnOpts, + extraOsdOpts: [ + ...options.extraOsdOpts, ...(options.installDir ? [] : ['--dev', '--no-dev-config']), ], }, @@ -150,7 +150,7 @@ export async function startServers(options) { log.success(makeSuccessMessage(options)); await procs.waitForAllToStop(); - await es.cleanup(); + await opensearch.cleanup(); }); } diff --git a/packages/kbn-test/src/functional_tests/test_helpers.js b/packages/osd-test/src/functional_tests/test_helpers.js similarity index 100% rename from packages/kbn-test/src/functional_tests/test_helpers.js rename to packages/osd-test/src/functional_tests/test_helpers.js From e86526ad6a2485237ab4309252329aa29846806a Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Thu, 4 Mar 2021 21:02:34 +0000 Subject: [PATCH 3/4] [Rename] in-corporate review comments Signed-off-by: Mihir Soni --- packages/osd-test/src/functional_tests/lib/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/osd-test/src/functional_tests/lib/auth.js b/packages/osd-test/src/functional_tests/lib/auth.js index 4677c0c14b4..bef24a34077 100644 --- a/packages/osd-test/src/functional_tests/lib/auth.js +++ b/packages/osd-test/src/functional_tests/lib/auth.js @@ -1,8 +1,8 @@ /* - * Licensed to opensearchsearch B.V. under one or more contributor + * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright - * ownership. opensearchsearch B.V. licenses this file to you under + * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at From 4a8b5e9a6eba2fb730ef3c77e229fe9eb8086e9f Mon Sep 17 00:00:00 2001 From: Mihir Soni Date: Mon, 8 Mar 2021 22:11:08 +0000 Subject: [PATCH 4/4] [Rename] accomodate PR review feedback Signed-off-by: Mihir Soni --- .../osd-test/src/functional_tests/cli/run_tests/args.js | 2 +- .../src/functional_tests/cli/start_servers/args.js | 2 +- .../osd-test/src/functional_tests/lib/run_opensearch.js | 4 ++-- packages/osd-test/src/functional_tests/tasks.js | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/osd-test/src/functional_tests/cli/run_tests/args.js b/packages/osd-test/src/functional_tests/cli/run_tests/args.js index 6b28e212813..270dff5afd7 100644 --- a/packages/osd-test/src/functional_tests/cli/run_tests/args.js +++ b/packages/osd-test/src/functional_tests/cli/run_tests/args.js @@ -31,7 +31,7 @@ const options = { opensearchFrom: { arg: '', choices: ['snapshot', 'source'], - desc: 'Build Elasticsearch from source or run from snapshot.', + desc: 'Build OpenSearch from source or run from snapshot.', defaultHelp: 'Default: $TEST_OPENSEARCH_FROM or snapshot', }, 'opensearch-dashboards-install-dir': { diff --git a/packages/osd-test/src/functional_tests/cli/start_servers/args.js b/packages/osd-test/src/functional_tests/cli/start_servers/args.js index 66be6eaa888..f5a8d6fe2bb 100644 --- a/packages/osd-test/src/functional_tests/cli/start_servers/args.js +++ b/packages/osd-test/src/functional_tests/cli/start_servers/args.js @@ -30,7 +30,7 @@ const options = { }, opensearchFrom: { arg: '', - desc: 'Build Elasticsearch from source, snapshot or path to existing install dir.', + desc: 'Build OpenSearch from source, snapshot or path to existing install dir.', defaultHelp: 'Default: $TEST_OPENSEARCH_FROM or snapshot', }, 'opensearch-dashboards-install-dir': { diff --git a/packages/osd-test/src/functional_tests/lib/run_opensearch.js b/packages/osd-test/src/functional_tests/lib/run_opensearch.js index ed64b018899..77239e64222 100644 --- a/packages/osd-test/src/functional_tests/lib/run_opensearch.js +++ b/packages/osd-test/src/functional_tests/lib/run_opensearch.js @@ -61,8 +61,8 @@ export async function runOpenSearch({ config, options }) { return cluster; } -function getRelativeCertificateAuthorityPath(esConfig = []) { - const caConfig = esConfig.find( +function getRelativeCertificateAuthorityPath(opensearchConfig = []) { + const caConfig = opensearchConfig.find( (config) => config.indexOf('--opensearch.ssl.certificateAuthorities') === 0 ); return caConfig ? caConfig.split('=')[1] : undefined; diff --git a/packages/osd-test/src/functional_tests/tasks.js b/packages/osd-test/src/functional_tests/tasks.js index 20841c7ecef..7e42d8b3499 100644 --- a/packages/osd-test/src/functional_tests/tasks.js +++ b/packages/osd-test/src/functional_tests/tasks.js @@ -24,7 +24,7 @@ import { withProcRunner } from '@osd/dev-utils'; import dedent from 'dedent'; import { - runElasticsearch, + runOpenSearch, runOpenSearchDashboardsServer, runFtr, assertNoneExcluded, @@ -40,7 +40,7 @@ const makeSuccessMessage = (options) => { return ( '\n\n' + dedent` - Elasticsearch and Opensearch Dashboards are ready for functional testing. Start the functional tests + OpenSearch and Opensearch Dashboards are ready for functional testing. Start the functional tests in another terminal session by running this command from this directory: node ${relative(process.cwd(), OPENSEARCH_DASHBOARDS_FTR_SCRIPT)}${installDirFlag} @@ -97,7 +97,7 @@ export async function runTests(options) { let opensearch; try { - opensearch = await runElasticsearch({ config, options: opts }); + opensearch = await runOpenSearch({ config, options: opts }); await runOpenSearchDashboardsServer({ procs, config, options: opts }); await runFtr({ configPath, options: opts }); } finally { @@ -131,7 +131,7 @@ export async function startServers(options) { await withProcRunner(log, async (procs) => { const config = await readConfigFile(log, options.config); - const opensearch = await runElasticsearch({ config, options: opts }); + const opensearch = await runOpenSearch({ config, options: opts }); await runOpenSearchDashboardsServer({ procs, config,