Skip to content

Commit

Permalink
[Rename] kbn-test in packages directory to osd-test/#37 [1] (#53)
Browse files Browse the repository at this point in the history
* [Rename] kbn-test in packages directory to osd-test/functional_test_runner

Signed-off-by: Mihir Soni <mihirsoni.123@gmail.com>

* [Rename] in-corporate review comments

Signed-off-by: Mihir Soni <mihirsoni.123@gmail.com>
  • Loading branch information
mihirsoni authored Mar 4, 2021
1 parent c2db144 commit 13d4688
Show file tree
Hide file tree
Showing 59 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import expect from '@kbn/expect';
import expect from '@osd/expect';

export default () => {
describe('app one', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
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';

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;
Expand All @@ -49,7 +49,7 @@ export function runFtrCli() {
grep: flags.grep || undefined,
invert: flags.invert,
},
kbnTestServer: {
osdTestServer: {
installDir: parseInstallDir(flags),
},
suiteFiles: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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
`,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -173,12 +173,12 @@ export const schema = Joi.object()

servers: Joi.object()
.keys({
kibana: urlPartsSchema(),
elasticsearch: urlPartsSchema(),
opensearchDashboards: urlPartsSchema(),
opensearch: urlPartsSchema(),
})
.default(),

esTestCluster: Joi.object()
opensearchTestCluster: Joi.object()
.keys({
license: Joi.string().default('oss'),
from: Joi.string().default('snapshot'),
Expand All @@ -189,7 +189,7 @@ export const schema = Joi.object()
})
.default(),

kbnTestServer: Joi.object()
osdTestServer: Joi.object()
.keys({
buildArgs: Joi.array(),
sourceArgs: Joi.array(),
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import Path from 'path';

import { REPO_ROOT } from '@kbn/utils';
import { REPO_ROOT } from '@osd/utils';

import { Lifecycle } from './lifecycle';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 13d4688

Please sign in to comment.