diff --git a/packages/kbn-test/README.md b/packages/kbn-test/README.md deleted file mode 100644 index 3159e5c2492b..000000000000 --- a/packages/kbn-test/README.md +++ /dev/null @@ -1,39 +0,0 @@ -Kibana Testing Library -====================== - -The @kbn/test package provides ways to run tests. Currently only functional testing is provided by this library, with unit and other testing possibly added here. - -Functional Testing -------------------- - -### Dependencies - -Functional testing methods exist in the `src/functional_tests` directory. They depend on the Functional Test Runner, which is found in [`{KIBANA_ROOT}/src/functional_test_runner`](../../src/functional_test_runner). Ideally libraries provided by kibana packages such as this one should not depend on kibana source code that lives in [`{KIBANA_ROOT}/src`](../../src). The goal is to start pulling test and development utilities out into packages so they can be used across Kibana and plugins. Accordingly the Functional Test Runner itself will be pulled out into a package (or part of a package), and this package's dependence on it will not be an issue. - -### Exposed methods - -#### runTests(configPaths: Array) -For each config file specified in configPaths, starts Elasticsearch and Kibana once, runs tests specified in that config file, and shuts down Elasticsearch and Kibana once completed. (Repeats for every config file.) - -`configPaths`: array of strings, each an absolute path to a config file that looks like [this](../../test/functional/config.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). - -Internally the method that starts Elasticsearch comes from [kbn-es](../../packages/kbn-es). - -#### startServers(configPath: string) -Starts Elasticsearch and Kibana servers given a specified config. - -`configPath`: absolute path to a config file that looks like [this](../../test/functional/config.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). - -Allows users to start another process to run just the tests while keeping the servers running with this method. Start servers _and_ run tests using the same config file ([see how](../../scripts/README.md)). - -## Rationale - -### Single config per setup - -We think it makes sense to specify the tests to run along with the particular server configuration for Elasticsearch and Kibana servers, because the tests expect a particular configuration. For example, saml api integration tests expect certain xml files to exist in Elasticsearch's config directory, and certain saml specific options to be passed in via the command line (or alternatively via the `.yml` config file) to both Elasticsearch and Kibana. It makes sense to keep all these config options together with the list of test files. - -### Multiple configs running in succession - -We also think it makes sense to have a test runner intelligently (but simply) start servers, run tests, tear down servers, and repeat for each config, uninterrupted. There's nothing special about each kind of config that specifies running some set of functional tests against some kind of Elasticsearch/Kibana servers. There doesn't need to be a separate job to run each kind of setup/test/teardown. These can all be orchestrated sequentially via the current `runTests` implementation. This is how we envision tests to run on CI. - -This inherently means that grouping test files in configs matters, such that a group of test files that depends on a particular server config appears together in that config's `testFiles` list. Given how quickly and easily we can start servers using [@kbn/es](../../packages/kbn-es), it should not impact performance to logically group tests by domain even if multiple groups of tests share the same server config. We can think about how to group test files together across domains when that time comes. diff --git a/packages/osd-test/README.md b/packages/osd-test/README.md new file mode 100644 index 000000000000..1d1afb2c226d --- /dev/null +++ b/packages/osd-test/README.md @@ -0,0 +1,39 @@ +OpenSearch Dashboards Testing Library +====================== + +The @osd/test package provides ways to run tests. Currently only functional testing is provided by this library, with unit and other testing possibly added here. + +Functional Testing +------------------- + +### Dependencies + +Functional testing methods exist in the `src/functional_tests` directory. They depend on the Functional Test Runner, which is found in [`{OPENSEARCH_DASHBOARDS_ROOT}/src/functional_test_runner`](../../src/functional_test_runner). Ideally libraries provided by opensearch-dashboards packages such as this one should not depend on opensearch-dashboards source code that lives in [`{OPENSEARCH_DASHBOARDS_ROOT}/src`](../../src). The goal is to start pulling test and development utilities out into packages so they can be used across OpenSearch Dashboards and plugins. Accordingly the Functional Test Runner itself will be pulled out into a package (or part of a package), and this package's dependence on it will not be an issue. + +### Exposed methods + +#### runTests(configPaths: Array) +For each config file specified in configPaths, starts OpenSearch and OpenSearch Dashboards once, runs tests specified in that config file, and shuts down OpenSearch and OpenSearch Dashboards once completed. (Repeats for every config file.) + +`configPaths`: array of strings, each an absolute path to a config file that looks like [this](../../test/functional/config.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). + +Internally the method that starts OpenSearch comes from [osd-opensearch](../../packages/osd-opensearch). + +#### startServers(configPath: string) +Starts OpenSearch and OpenSearch Dashboards servers given a specified config. + +`configPath`: absolute path to a config file that looks like [this](../../test/functional/config.js), following the config schema specified [here](../../src/functional_test_runner/lib/config/schema.js). + +Allows users to start another process to run just the tests while keeping the servers running with this method. Start servers _and_ run tests using the same config file ([see how](../../scripts/README.md)). + +## Rationale + +### Single config per setup + +We think it makes sense to specify the tests to run along with the particular server configuration for OpenSearch and OpenSearch Dashboards servers, because the tests expect a particular configuration. For example, saml api integration tests expect certain xml files to exist in OpenSearch's config directory, and certain saml specific options to be passed in via the command line (or alternatively via the `.yml` config file) to both OpenSearch and OpenSearch Dashboards. It makes sense to keep all these config options together with the list of test files. + +### Multiple configs running in succession + +We also think it makes sense to have a test runner intelligently (but simply) start servers, run tests, tear down servers, and repeat for each config, uninterrupted. There's nothing special about each kind of config that specifies running some set of functional tests against some kind of OpenSearch/OpenSearch Dashboards servers. There doesn't need to be a separate job to run each kind of setup/test/teardown. These can all be orchestrated sequentially via the current `runTests` implementation. This is how we envision tests to run on CI. + +This inherently means that grouping test files in configs matters, such that a group of test files that depends on a particular server config appears together in that config's `testFiles` list. Given how quickly and easily we can start servers using [@osd/opensearch](../../packages/osd-opensearch), it should not impact performance to logically group tests by domain even if multiple groups of tests share the same server config. We can think about how to group test files together across domains when that time comes. diff --git a/packages/kbn-test/babel.config.js b/packages/osd-test/babel.config.js similarity index 94% rename from packages/kbn-test/babel.config.js rename to packages/osd-test/babel.config.js index ff657603f4c8..0d4b6bc52f84 100644 --- a/packages/kbn-test/babel.config.js +++ b/packages/osd-test/babel.config.js @@ -18,6 +18,6 @@ */ module.exports = { - presets: ['@kbn/babel-preset/node_preset'], + presets: ['@osd/babel-preset/node_preset'], ignore: ['**/*.test.js'], }; diff --git a/packages/kbn-test/index.d.ts b/packages/osd-test/index.d.ts similarity index 100% rename from packages/kbn-test/index.d.ts rename to packages/osd-test/index.d.ts diff --git a/packages/kbn-test/package.json b/packages/osd-test/package.json similarity index 80% rename from packages/kbn-test/package.json rename to packages/osd-test/package.json index f5b34314052c..c51d63e5beb5 100644 --- a/packages/kbn-test/package.json +++ b/packages/osd-test/package.json @@ -1,22 +1,22 @@ { - "name": "@kbn/test", + "name": "@osd/test", "version": "1.0.0", "private": true, "license": "Apache-2.0", "main": "./target/index.js", "scripts": { "build": "babel src --out-dir target --delete-dir-on-start --extensions .ts,.js,.tsx --ignore *.test.js,**/__tests__/** --source-maps=inline", - "kbn:bootstrap": "yarn build", - "kbn:watch": "yarn build --watch" + "osd:bootstrap": "yarn build", + "osd:watch": "yarn build --watch" }, - "kibana": { + "opensearchDashboards": { "devOnly": true }, "devDependencies": { "@babel/cli": "^7.10.5", - "@kbn/babel-preset": "1.0.0", - "@kbn/dev-utils": "1.0.0", - "@kbn/utils": "1.0.0", + "@osd/babel-preset": "1.0.0", + "@osd/dev-utils": "1.0.0", + "@osd/utils": "1.0.0", "@types/joi": "^13.4.2", "@types/lodash": "^4.14.159", "@types/parse-link-header": "^1.0.0", diff --git a/packages/kbn-test/src/ci_parallel_process_prefix.ts b/packages/osd-test/src/ci_parallel_process_prefix.ts similarity index 100% rename from packages/kbn-test/src/ci_parallel_process_prefix.ts rename to packages/osd-test/src/ci_parallel_process_prefix.ts diff --git a/packages/osd-test/src/failed_tests_reporter/index.ts b/packages/osd-test/src/failed_tests_reporter/index.ts index 1332f08eb4e1..6f3f84af2fd1 100644 --- a/packages/osd-test/src/failed_tests_reporter/index.ts +++ b/packages/osd-test/src/failed_tests_reporter/index.ts @@ -17,4 +17,5 @@ * under the License. */ -export { runFailedTestsReporterCli } from './run_failed_tests_reporter_cli'; +export { osdTestConfig } from './osd_test_config'; +export { opensearchDashboardsTestUser, opensearchDashboardsServerTestUser, adminTestUser } from './users'; diff --git a/packages/kbn-test/src/index.ts b/packages/osd-test/src/index.ts similarity index 86% rename from packages/kbn-test/src/index.ts rename to packages/osd-test/src/index.ts index bc487782a4a3..6eac99881d6c 100644 --- a/packages/kbn-test/src/index.ts +++ b/packages/osd-test/src/index.ts @@ -31,13 +31,13 @@ export { runTestsCli, processRunTestsCliOptions, startServersCli, processStartSe export { runTests, startServers } from './functional_tests/tasks'; // @ts-ignore not typed yet -export { KIBANA_ROOT } from './functional_tests/lib/paths'; +export { OPENSEARCH_DASHBOARDS_ROOT } from './functional_tests/lib/paths'; // @ts-ignore not typed yet -export { esTestConfig, createLegacyEsTestCluster } from './legacy_es'; +export { opensearchTestConfig, createLegacyEsTestCluster } from './legacy_opensearch'; // @ts-ignore not typed yet -export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn'; +export { osdTestConfig, opensearchDashboardsServerTestUser, opensearchDashboardsTestUser, adminTestUser } from './osd'; // @ts-ignore not typed yet export { setupUsers, DEFAULT_SUPERUSER_PASS } from './functional_tests/lib/auth'; diff --git a/packages/kbn-test/src/junit_report_path.ts b/packages/osd-test/src/junit_report_path.ts similarity index 100% rename from packages/kbn-test/src/junit_report_path.ts rename to packages/osd-test/src/junit_report_path.ts diff --git a/packages/kbn-test/src/legacy_es/index.js b/packages/osd-test/src/legacy_opensearch/index.js similarity index 83% rename from packages/kbn-test/src/legacy_es/index.js rename to packages/osd-test/src/legacy_opensearch/index.js index 8691b7b81152..ac72c15b9575 100644 --- a/packages/kbn-test/src/legacy_es/index.js +++ b/packages/osd-test/src/legacy_opensearch/index.js @@ -17,5 +17,5 @@ * under the License. */ -export { createLegacyEsTestCluster } from './legacy_es_test_cluster.js'; -export { esTestConfig } from './es_test_config'; +export { createLegacyOpenSearchTestCluster } from './legacy_opensearch_test_cluster.js'; +export { opensearchTestConfig } from './opensearch_test_config'; diff --git a/packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js b/packages/osd-test/src/legacy_opensearch/legacy_opensearch_test_cluster.js similarity index 61% rename from packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js rename to packages/osd-test/src/legacy_opensearch/legacy_opensearch_test_cluster.js index 4606e68ba316..8f074873615d 100644 --- a/packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js +++ b/packages/osd-test/src/legacy_opensearch/legacy_opensearch_test_cluster.js @@ -20,72 +20,72 @@ import { resolve } from 'path'; import { format } from 'url'; import { get, toPath } from 'lodash'; -import { Cluster } from '@kbn/es'; +import { Cluster } from '@osd/opensearch'; import { CI_PARALLEL_PROCESS_PREFIX } from '../ci_parallel_process_prefix'; -import { esTestConfig } from './es_test_config'; +import { opensearchTestConfig } from './opensearch_test_config'; -import { KIBANA_ROOT } from '../'; -import * as legacyElasticsearch from 'elasticsearch'; +import { OPENSEARCH_DASHBOARDS_ROOT } from '../'; +import * as legacyOpenSearch from 'elasticsearch'; const path = require('path'); const del = require('del'); -export function createLegacyEsTestCluster(options = {}) { +export function createLegacyOpenSearchTestCluster(options = {}) { const { - port = esTestConfig.getPort(), + port = opensearchTestConfig.getPort(), password = 'changeme', license = 'oss', log, - basePath = resolve(KIBANA_ROOT, '.es'), - esFrom = esTestConfig.getBuildFrom(), + basePath = resolve(OPENSEARCH_DASHBOARDS_ROOT, '.opensearch'), + opensearchFrom = opensearchTestConfig.getBuildFrom(), dataArchive, - esArgs: customEsArgs = [], - esEnvVars, - clusterName: customClusterName = 'es-test-cluster', + opensearchArgs: customOpenSearchArgs = [], + opensearchEnvVars, + clusterName: customClusterName = 'opensearch-test-cluster', ssl, } = options; const clusterName = `${CI_PARALLEL_PROCESS_PREFIX}${customClusterName}`; - const esArgs = [ + const opensearchArgs = [ `cluster.name=${clusterName}`, `http.port=${port}`, 'discovery.type=single-node', - `transport.port=${esTestConfig.getTransportPort()}`, + `transport.port=${opensearchTestConfig.getTransportPort()}`, `indices.id_field_data.enabled=false`, - ...customEsArgs, + ...customOpenSearchArgs, ]; const config = { - version: esTestConfig.getVersion(), + version: opensearchTestConfig.getVersion(), installPath: resolve(basePath, clusterName), - sourcePath: resolve(KIBANA_ROOT, '../elasticsearch'), + sourcePath: resolve(OPENSEARCH_DASHBOARDS_ROOT, '../opensearch'), password, license, basePath, - esArgs, + opensearchArgs, }; const cluster = new Cluster({ log, ssl }); - return new (class EsTestCluster { + return new (class OpenSearchTestCluster { getStartTimeout() { const second = 1000; const minute = second * 60; - return esFrom === 'snapshot' ? 3 * minute : 6 * minute; + return opensearchFrom === 'snapshot' ? 3 * minute : 6 * minute; } async start() { let installPath; - if (esFrom === 'source') { + if (opensearchFrom === 'source') { installPath = (await cluster.installSource(config)).installPath; - } else if (esFrom === 'snapshot') { + } else if (opensearchFrom === 'snapshot') { installPath = (await cluster.installSnapshot(config)).installPath; - } else if (path.isAbsolute(esFrom)) { - installPath = esFrom; + } else if (path.isAbsolute(opensearchFrom)) { + installPath = opensearchFrom; } else { - throw new Error(`unknown option esFrom "${esFrom}"`); + throw new Error(`unknown option opensearchFrom "${opensearchFrom}"`); } if (dataArchive) { @@ -94,27 +94,27 @@ export function createLegacyEsTestCluster(options = {}) { await cluster.start(installPath, { password: config.password, - esArgs, - esEnvVars, + opensearchArgs, + opensearchEnvVars, }); } async stop() { await cluster.stop(); - log.info('[es] stopped'); + log.info('[opensearch] stopped'); } async cleanup() { await this.stop(); await del(config.installPath, { force: true }); - log.info('[es] cleanup complete'); + log.info('[opensearch] cleanup complete'); } /** - * Returns an ES Client to the configured cluster + * Returns an opensearch Client to the configured cluster */ getClient() { - return new legacyElasticsearch.Client({ + return new legacyOpenSearch.Client({ host: this.getUrl(), }); } @@ -124,7 +124,7 @@ export function createLegacyEsTestCluster(options = {}) { } getUrl() { - const parts = esTestConfig.getUrlParts(); + const parts = opensearchTestConfig.getUrlParts(); parts.port = port; return format(parts); @@ -136,16 +136,16 @@ export function createLegacyEsTestCluster(options = {}) { * Create a callCluster function that properly executes methods on an * elasticsearch-js client * - * @param {elasticsearch.Client} esClient + * @param {elasticsearch.Client} opensearchClient * @return {Function} */ -function createCallCluster(esClient) { +function createCallCluster(opensearchClient) { return function callCluster(method, params) { const path = toPath(method); const contextPath = path.slice(0, -1); - const action = get(esClient, path); - const context = contextPath.length ? get(esClient, contextPath) : esClient; + const action = get(opensearchClient, path); + const context = contextPath.length ? get(opensearchClient, contextPath) : opensearchClient; return action.call(context, params); }; diff --git a/packages/kbn-test/src/legacy_es/es_test_config.js b/packages/osd-test/src/legacy_opensearch/opensearch_test_config.js similarity index 51% rename from packages/kbn-test/src/legacy_es/es_test_config.js rename to packages/osd-test/src/legacy_opensearch/opensearch_test_config.js index d1d2b050c646..ee90b450ba7e 100644 --- a/packages/kbn-test/src/legacy_es/es_test_config.js +++ b/packages/osd-test/src/legacy_opensearch/opensearch_test_config.js @@ -19,11 +19,11 @@ import url, { format as formatUrl } from 'url'; import pkg from '../../../../package.json'; -import { adminTestUser } from '../kbn'; +import { adminTestUser } from '../osd'; -export const esTestConfig = new (class EsTestConfig { +export const opensearchTestConfig = new (class OpenSearchTestConfig { getVersion() { - return process.env.TEST_ES_BRANCH || pkg.version; + return process.env.TEST_OPENSEARCH_BRANCH || pkg.version; } getPort() { @@ -35,37 +35,37 @@ export const esTestConfig = new (class EsTestConfig { } getBuildFrom() { - return process.env.TEST_ES_FROM || 'snapshot'; + return process.env.TEST_OPENSEARCH_FROM || 'snapshot'; } getTransportPort() { - return process.env.TEST_ES_TRANSPORT_PORT || '9300-9400'; + return process.env.TEST_OPENSEARCH_TRANSPORT_PORT || '9300-9400'; } getUrlParts() { - // Allow setting one complete TEST_ES_URL for Es like https://elastic:changeme@myCloudInstance:9200 - if (process.env.TEST_ES_URL) { - const testEsUrl = url.parse(process.env.TEST_ES_URL); + // Allow setting one complete TEST_OPENSEARCH_URL for opensearch like https://elastic:changeme@myCloudInstance:9200 + if (process.env.TEST_OPENSEARCH_URL) { + const testOpenSearchUrl = url.parse(process.env.TEST_OPENSEARCH_URL); return { // have to remove the ":" off protocol - protocol: testEsUrl.protocol.slice(0, -1), - hostname: testEsUrl.hostname, - port: parseInt(testEsUrl.port, 10), - username: testEsUrl.auth.split(':')[0], - password: testEsUrl.auth.split(':')[1], - auth: testEsUrl.auth, + protocol: testOpenSearchUrl.protocol.slice(0, -1), + hostname: testOpenSearchUrl.hostname, + port: parseInt(testOpenSearchUrl.port, 10), + username: testOpenSearchUrl.auth.split(':')[0], + password: testOpenSearchUrl.auth.split(':')[1], + auth: testOpenSearchUrl.auth, }; } - const username = process.env.TEST_ES_USERNAME || adminTestUser.username; - const password = process.env.TEST_ES_PASSWORD || adminTestUser.password; + const username = process.env.TEST_OPENSEARCH_USERNAME || adminTestUser.username; + const password = process.env.TEST_OPENSEARCH_PASSWORD || adminTestUser.password; return { // Allow setting any individual component(s) of the URL, - // or use default values (username and password from ../kbn/users.js) - protocol: process.env.TEST_ES_PROTOCOL || 'http', - hostname: process.env.TEST_ES_HOSTNAME || 'localhost', - port: parseInt(process.env.TEST_ES_PORT, 10) || 9220, + // or use default values (username and password from ../osd/users.js) + protocol: process.env.TEST_OPENSEARCH_PROTOCOL || 'http', + hostname: process.env.TEST_OPENSEARCH_HOSTNAME || 'localhost', + port: parseInt(process.env.TEST_OPENSEARCH_PORT, 10) || 9220, auth: `${username}:${password}`, username: username, password: password, diff --git a/packages/kbn-test/src/kbn/index.ts b/packages/osd-test/src/osd/index.ts similarity index 83% rename from packages/kbn-test/src/kbn/index.ts rename to packages/osd-test/src/osd/index.ts index 4ce3d06d3c8f..6f3f84af2fd1 100644 --- a/packages/kbn-test/src/kbn/index.ts +++ b/packages/osd-test/src/osd/index.ts @@ -17,5 +17,5 @@ * under the License. */ -export { kbnTestConfig } from './kbn_test_config'; -export { kibanaTestUser, kibanaServerTestUser, adminTestUser } from './users'; +export { osdTestConfig } from './osd_test_config'; +export { opensearchDashboardsTestUser, opensearchDashboardsServerTestUser, adminTestUser } from './users'; diff --git a/packages/osd-test/src/osd/osd_test_config.ts b/packages/osd-test/src/osd/osd_test_config.ts new file mode 100644 index 000000000000..121b045b96b8 --- /dev/null +++ b/packages/osd-test/src/osd/osd_test_config.ts @@ -0,0 +1,61 @@ +/* + * 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 url from 'url'; +import { opensearchDashboardsTestUser } from './users'; + +interface UrlParts { + protocol?: string; + hostname?: string; + port?: number; + auth?: string; + username?: string; + password?: string; +} + +export const osdTestConfig = new (class OsdTestConfig { + getPort() { + return this.getUrlParts().port; + } + + getUrlParts(): UrlParts { + // allow setting one complete TEST_OPENSEARCH_DASHBOARDS_URL for opensearch like https://opensearch:changeme@example.com:9200 + if (process.env.TEST_OPENSEARCH_DASHBOARDS_URL) { + const testOpenSearchDashboardsUrl = url.parse(process.env.TEST_OPENSEARCH_DASHBOARDS_URL); + return { + protocol: testOpenSearchDashboardsUrl.protocol?.slice(0, -1), + hostname: testOpenSearchDashboardsUrl.hostname, + port: testOpenSearchDashboardsUrl.port ? parseInt(testOpenSearchDashboardsUrl.port, 10) : undefined, + auth: testOpenSearchDashboardsUrl.auth, + username: testOpenSearchDashboardsUrl.auth?.split(':')[0], + password: testOpenSearchDashboardsUrl.auth?.split(':')[1], + }; + } + + const username = process.env.TEST_OPENSEARCH_DASHBOARDS_USERNAME || opensearchDashboardsTestUser.username; + const password = process.env.TEST_OPENSEARCH_DASHBOARDS_PASSWORD || opensearchDashboardsTestUser.password; + return { + protocol: process.env.TEST_OPENSEARCH_DASHBOARDS_PROTOCOL || 'http', + hostname: process.env.TEST_OPENSEARCH_DASHBOARDS_HOSTNAME || 'localhost', + port: process.env.TEST_OPENSEARCH_DASHBOARDS_PORT ? parseInt(process.env.TEST_OPENSEARCH_DASHBOARDS_PORT, 10) : 5620, + auth: `${username}:${password}`, + username, + password, + }; + } +})(); diff --git a/packages/kbn-test/src/kbn/users.ts b/packages/osd-test/src/osd/users.ts similarity index 64% rename from packages/kbn-test/src/kbn/users.ts rename to packages/osd-test/src/osd/users.ts index 1d4a903d60cf..09ce08d47c64 100644 --- a/packages/kbn-test/src/kbn/users.ts +++ b/packages/osd-test/src/osd/users.ts @@ -19,17 +19,17 @@ const env = process.env; -export const kibanaTestUser = { - username: env.TEST_KIBANA_USER || 'elastic', - password: env.TEST_KIBANA_PASS || 'changeme', +export const opensearchDashboardsTestUser = { + username: env.TEST_OPENSEARCH_DASHBOARDS_USER || 'opensearch', + password: env.TEST_OPENSEARCH_DASHBOARDS_PASS || 'changeme', }; -export const kibanaServerTestUser = { - username: env.TEST_KIBANA_SERVER_USER || 'kibana', - password: env.TEST_KIBANA_SERVER_PASS || 'changeme', +export const opensearchDashboardsServerTestUser = { + username: env.TEST_OPENSEARCH_DASHBOARDS_SERVER_USER || 'opensearch', + password: env.TEST_OPENSEARCH_DASHBOARDS_SERVER_PASS || 'changeme', }; export const adminTestUser = { - username: env.TEST_ES_USER || 'elastic', - password: env.TEST_ES_PASS || 'changeme', + username: env.TEST_OPENSEARCH_USER || 'opensearch', + password: env.TEST_OPENSEARCH_PASS || 'changeme', }; diff --git a/packages/kbn-test/tsconfig.json b/packages/osd-test/tsconfig.json similarity index 69% rename from packages/kbn-test/tsconfig.json rename to packages/osd-test/tsconfig.json index fec35e45b2a1..5c765855fab3 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/osd-test/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-test" + "tsBuildInfoFile": "../../build/tsbuildinfo/packages/osd-test" }, "include": [ "types/**/*", diff --git a/packages/kbn-test/types/README.md b/packages/osd-test/types/README.md similarity index 76% rename from packages/kbn-test/types/README.md rename to packages/osd-test/types/README.md index 1298d2a4afc0..efe8b4e6197a 100644 --- a/packages/kbn-test/types/README.md +++ b/packages/osd-test/types/README.md @@ -1,5 +1,5 @@ -# @kbn/test/types +# @osd/test/types Shared types used by different parts of the tests - - **`ftr.d.ts`**: These types are generic types for using the functional test runner. They are here because we plan to move the functional test runner into the `@kbn/test` package at some point and having them here makes them a lot easier to import from all over the place like we do. \ No newline at end of file + - **`ftr.d.ts`**: These types are generic types for using the functional test runner. They are here because we plan to move the functional test runner into the `@osd/test` package at some point and having them here makes them a lot easier to import from all over the place like we do. \ No newline at end of file diff --git a/packages/kbn-test/types/ftr.d.ts b/packages/osd-test/types/ftr.d.ts similarity index 98% rename from packages/kbn-test/types/ftr.d.ts rename to packages/osd-test/types/ftr.d.ts index 38eb69d3e681..b82ccb4e832e 100644 --- a/packages/kbn-test/types/ftr.d.ts +++ b/packages/osd-test/types/ftr.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@osd/dev-utils'; import { Config, Lifecycle, diff --git a/packages/kbn-test/yarn.lock b/packages/osd-test/yarn.lock similarity index 100% rename from packages/kbn-test/yarn.lock rename to packages/osd-test/yarn.lock