diff --git a/packages/kbn-test/src/legacy_es/es_test_config.js b/packages/kbn-test/src/es/es_test_config.ts similarity index 66% rename from packages/kbn-test/src/legacy_es/es_test_config.js rename to packages/kbn-test/src/es/es_test_config.ts index 151587d95ca2..db5d705710a7 100644 --- a/packages/kbn-test/src/legacy_es/es_test_config.js +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -7,10 +7,10 @@ */ import { kibanaPackageJson as pkg } from '@kbn/dev-utils'; -import url, { format as formatUrl } from 'url'; +import Url from 'url'; import { adminTestUser } from '../kbn'; -export const esTestConfig = new (class EsTestConfig { +class EsTestConfig { getVersion() { return process.env.TEST_ES_BRANCH || pkg.version; } @@ -20,7 +20,7 @@ export const esTestConfig = new (class EsTestConfig { } getUrl() { - return formatUrl(this.getUrlParts()); + return Url.format(this.getUrlParts()); } getBuildFrom() { @@ -34,14 +34,19 @@ export const esTestConfig = new (class EsTestConfig { 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); + const testEsUrl = Url.parse(process.env.TEST_ES_URL); + if (!testEsUrl.port) { + throw new Error( + `process.env.TEST_ES_URL must contain port. given: ${process.env.TEST_ES_URL}` + ); + } return { // have to remove the ":" off protocol - protocol: testEsUrl.protocol.slice(0, -1), + protocol: testEsUrl.protocol?.slice(0, -1), hostname: testEsUrl.hostname, port: parseInt(testEsUrl.port, 10), - username: testEsUrl.auth.split(':')[0], - password: testEsUrl.auth.split(':')[1], + username: testEsUrl.auth?.split(':')[0], + password: testEsUrl.auth?.split(':')[1], auth: testEsUrl.auth, }; } @@ -49,15 +54,25 @@ export const esTestConfig = new (class EsTestConfig { const username = process.env.TEST_ES_USERNAME || adminTestUser.username; const password = process.env.TEST_ES_PASSWORD || adminTestUser.password; + const port = process.env.TEST_ES_PORT ? parseInt(process.env.TEST_ES_PORT, 10) : 9220; + + if (Number.isNaN(port)) { + throw new Error( + `process.env.TEST_ES_PORT must contain a valid port. given: ${process.env.TEST_ES_PORT}` + ); + } + 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, + port, auth: `${username}:${password}`, - username: username, - password: password, + username, + password, }; } -})(); +} + +export const esTestConfig = new EsTestConfig(); diff --git a/packages/kbn-test/src/legacy_es/index.js b/packages/kbn-test/src/es/index.ts similarity index 84% rename from packages/kbn-test/src/legacy_es/index.js rename to packages/kbn-test/src/es/index.ts index e32f9137181d..0770ac82596f 100644 --- a/packages/kbn-test/src/legacy_es/index.js +++ b/packages/kbn-test/src/es/index.ts @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { createLegacyEsTestCluster } from './legacy_es_test_cluster.js'; +export { createTestEsCluster } from './test_es_cluster'; export { esTestConfig } from './es_test_config'; diff --git a/packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js b/packages/kbn-test/src/es/test_es_cluster.ts similarity index 70% rename from packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js rename to packages/kbn-test/src/es/test_es_cluster.ts index d472f27395ff..e802613fbaed 100644 --- a/packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js +++ b/packages/kbn-test/src/es/test_es_cluster.ts @@ -6,25 +6,49 @@ * Side Public License, v 1. */ -import { resolve } from 'path'; +import Path from 'path'; import { format } from 'url'; -import { get, toPath } from 'lodash'; +import del from 'del'; +// @ts-expect-error in js import { Cluster } from '@kbn/es'; +import { Client } from '@elastic/elasticsearch'; +import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; +import type { ToolingLog } from '@kbn/dev-utils'; import { CI_PARALLEL_PROCESS_PREFIX } from '../ci_parallel_process_prefix'; import { esTestConfig } from './es_test_config'; -import { Client } from '@elastic/elasticsearch'; import { KIBANA_ROOT } from '../'; -const path = require('path'); -const del = require('del'); -export function createLegacyEsTestCluster(options = {}) { +interface TestClusterFactoryOptions { + port?: number; + password?: string; + license?: 'basic' | 'trial'; // | 'oss' + basePath?: string; + esFrom?: string; + /** + * Path to data archive snapshot to run Elasticsearch with. + * To prepare the the snapshot: + * - run Elasticsearch server + * - index necessary data + * - stop Elasticsearch server + * - go to Elasticsearch folder: cd .es/${ELASTICSEARCH_VERSION} + * - archive data folder: zip -r my_archive.zip data + * */ + dataArchive?: string; + esArgs?: string[]; + esEnvVars?: Record; + clusterName?: string; + log: ToolingLog; + ssl?: boolean; +} + +export function createTestEsCluster(options: TestClusterFactoryOptions) { const { port = esTestConfig.getPort(), password = 'changeme', license = 'basic', log, - basePath = resolve(KIBANA_ROOT, '.es'), + basePath = Path.resolve(KIBANA_ROOT, '.es'), esFrom = esTestConfig.getBuildFrom(), dataArchive, esArgs: customEsArgs = [], @@ -45,8 +69,8 @@ export function createLegacyEsTestCluster(options = {}) { const config = { version: esTestConfig.getVersion(), - installPath: resolve(basePath, clusterName), - sourcePath: resolve(KIBANA_ROOT, '../elasticsearch'), + installPath: Path.resolve(basePath, clusterName), + sourcePath: Path.resolve(KIBANA_ROOT, '../elasticsearch'), password, license, basePath, @@ -70,7 +94,7 @@ export function createLegacyEsTestCluster(options = {}) { installPath = (await cluster.installSource(config)).installPath; } else if (esFrom === 'snapshot') { installPath = (await cluster.installSnapshot(config)).installPath; - } else if (path.isAbsolute(esFrom)) { + } else if (Path.isAbsolute(esFrom)) { installPath = esFrom; } else { throw new Error(`unknown option esFrom "${esFrom}"`); @@ -101,16 +125,12 @@ export function createLegacyEsTestCluster(options = {}) { /** * Returns an ES Client to the configured cluster */ - getClient() { + getClient(): KibanaClient { return new Client({ node: this.getUrl(), }); } - getCallCluster() { - return createCallCluster(this.getClient()); - } - getUrl() { const parts = esTestConfig.getUrlParts(); parts.port = port; @@ -119,22 +139,3 @@ export function createLegacyEsTestCluster(options = {}) { } })(); } - -/** - * Create a callCluster function that properly executes methods on an - * elasticsearch-js client - * - * @param {elasticsearch.Client} esClient - * @return {Function} - */ -function createCallCluster(esClient) { - 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; - - return action.call(context, params); - }; -} diff --git a/packages/kbn-test/src/functional_tests/lib/auth.js b/packages/kbn-test/src/functional_tests/lib/auth.ts similarity index 53% rename from packages/kbn-test/src/functional_tests/lib/auth.js rename to packages/kbn-test/src/functional_tests/lib/auth.ts index 22c84cd7d13d..abd1e0f9e7d5 100644 --- a/packages/kbn-test/src/functional_tests/lib/auth.js +++ b/packages/kbn-test/src/functional_tests/lib/auth.ts @@ -9,14 +9,25 @@ import fs from 'fs'; import util from 'util'; import { format as formatUrl } from 'url'; - import request from 'request'; -import { delay } from 'bluebird'; +import type { ToolingLog } from '@kbn/dev-utils'; export const DEFAULT_SUPERUSER_PASS = 'changeme'; - const readFile = util.promisify(fs.readFile); +function delay(delayMs: number) { + return new Promise((res) => setTimeout(res, delayMs)); +} + +interface UpdateCredentialsOptions { + port: number; + auth: string; + username: string; + password: string; + retries?: number; + protocol: string; + caCert?: Buffer | string; +} async function updateCredentials({ port, auth, @@ -25,27 +36,28 @@ async function updateCredentials({ retries = 10, protocol, caCert, -}) { - const result = await new Promise((resolve, reject) => - request( - { - method: 'PUT', - uri: formatUrl({ - protocol: `${protocol}:`, - auth, - hostname: 'localhost', - port, - pathname: `/_security/user/${username}/_password`, - }), - json: true, - body: { password }, - ca: caCert, - }, - (err, httpResponse, body) => { - if (err) return reject(err); - resolve({ httpResponse, body }); - } - ) +}: UpdateCredentialsOptions): Promise { + const result = await new Promise<{ body: any; httpResponse: request.Response }>( + (resolve, reject) => + request( + { + method: 'PUT', + uri: formatUrl({ + protocol: `${protocol}:`, + auth, + hostname: 'localhost', + port, + pathname: `/_security/user/${username}/_password`, + }), + json: true, + body: { password }, + ca: caCert, + }, + (err, httpResponse, body) => { + if (err) return reject(err); + resolve({ httpResponse, body }); + } + ) ); const { body, httpResponse } = result; @@ -71,11 +83,25 @@ async function updateCredentials({ throw new Error(`${statusCode} response, expected 200 -- ${JSON.stringify(body)}`); } -export async function setupUsers({ log, esPort, updates, protocol = 'http', caPath }) { +interface SetupUsersOptions { + log: ToolingLog; + esPort: number; + updates: Array<{ username: string; password: string; roles?: string[] }>; + protocol?: string; + caPath?: string; +} + +export async function setupUsers({ + log, + esPort, + updates, + protocol = 'http', + caPath, +}: SetupUsersOptions): Promise { // track the current credentials for the `elastic` user as // they will likely change as we apply updates let auth = `elastic:${DEFAULT_SUPERUSER_PASS}`; - const caCert = caPath && (await readFile(caPath)); + const caCert = caPath ? await readFile(caPath) : undefined; for (const { username, password, roles } of updates) { // If working with a built-in user, just change the password @@ -95,6 +121,16 @@ export async function setupUsers({ log, esPort, updates, protocol = 'http', caPa } } +interface InserUserOptions { + port: number; + auth: string; + username: string; + password: string; + roles?: string[]; + retries?: number; + protocol: string; + caCert?: Buffer | string; +} async function insertUser({ port, auth, @@ -104,27 +140,28 @@ async function insertUser({ retries = 10, protocol, caCert, -}) { - const result = await new Promise((resolve, reject) => - request( - { - method: 'POST', - uri: formatUrl({ - protocol: `${protocol}:`, - auth, - hostname: 'localhost', - port, - pathname: `/_security/user/${username}`, - }), - json: true, - body: { password, roles }, - ca: caCert, - }, - (err, httpResponse, body) => { - if (err) return reject(err); - resolve({ httpResponse, body }); - } - ) +}: InserUserOptions): Promise { + const result = await new Promise<{ body: any; httpResponse: request.Response }>( + (resolve, reject) => + request( + { + method: 'POST', + uri: formatUrl({ + protocol: `${protocol}:`, + auth, + hostname: 'localhost', + port, + pathname: `/_security/user/${username}`, + }), + json: true, + body: { password, roles }, + ca: caCert, + }, + (err, httpResponse, body) => { + if (err) return reject(err); + resolve({ httpResponse, body }); + } + ) ); const { body, httpResponse } = result; diff --git a/packages/kbn-test/src/functional_tests/lib/paths.js b/packages/kbn-test/src/functional_tests/lib/paths.ts similarity index 96% rename from packages/kbn-test/src/functional_tests/lib/paths.js rename to packages/kbn-test/src/functional_tests/lib/paths.ts index 0bdfa8a312ea..37cd708de1e0 100644 --- a/packages/kbn-test/src/functional_tests/lib/paths.js +++ b/packages/kbn-test/src/functional_tests/lib/paths.ts @@ -11,7 +11,7 @@ import { resolve, relative } from 'path'; // resolve() treats relative paths as relative to process.cwd(), // so to return a relative path we use relative() -function resolveRelative(path) { +function resolveRelative(path: string) { return relative(process.cwd(), resolve(path)); } diff --git a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts similarity index 79% rename from packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js rename to packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts index 4a2f8ecf6174..83368783da38 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js +++ b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts @@ -7,12 +7,24 @@ */ import { resolve } from 'path'; +import type { ToolingLog } from '@kbn/dev-utils'; import { KIBANA_ROOT } from './paths'; -import { createLegacyEsTestCluster } from '../../legacy_es'; +import type { Config } from '../../functional_test_runner/'; +import { createTestEsCluster } from '../../es'; import { setupUsers, DEFAULT_SUPERUSER_PASS } from './auth'; -export async function runElasticsearch({ config, options }) { +interface RunElasticsearchOptions { + log: ToolingLog; + esFrom: string; +} +export async function runElasticsearch({ + config, + options, +}: { + config: Config; + options: RunElasticsearchOptions; +}) { const { log, esFrom } = options; const ssl = config.get('esTestCluster.ssl'); const license = config.get('esTestCluster.license'); @@ -20,7 +32,7 @@ export async function runElasticsearch({ config, options }) { const esEnvVars = config.get('esTestCluster.serverEnvVars'); const isSecurityEnabled = esArgs.includes('xpack.security.enabled=true'); - const cluster = createLegacyEsTestCluster({ + const cluster = createTestEsCluster({ port: config.get('servers.elasticsearch.port'), password: isSecurityEnabled ? DEFAULT_SUPERUSER_PASS @@ -50,7 +62,7 @@ export async function runElasticsearch({ config, options }) { return cluster; } -function getRelativeCertificateAuthorityPath(esConfig = []) { +function getRelativeCertificateAuthorityPath(esConfig: string[] = []) { const caConfig = esConfig.find( (config) => config.indexOf('--elasticsearch.ssl.certificateAuthorities') === 0 ); diff --git a/packages/kbn-test/src/index.ts b/packages/kbn-test/src/index.ts index ef167bc5d781..dd5343b0118b 100644 --- a/packages/kbn-test/src/index.ts +++ b/packages/kbn-test/src/index.ts @@ -18,24 +18,17 @@ import { // @internal export { runTestsCli, processRunTestsCliOptions, startServersCli, processStartServersCliOptions }; -// @ts-ignore not typed yet +// @ts-expect-error not typed yet // @internal export { runTests, startServers } from './functional_tests/tasks'; -// @ts-ignore not typed yet // @internal export { KIBANA_ROOT } from './functional_tests/lib/paths'; -// @ts-ignore not typed yet -// @internal -export { esTestConfig, createLegacyEsTestCluster } from './legacy_es'; +export { esTestConfig, createTestEsCluster } from './es'; -// @ts-ignore not typed yet -// @internal export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn'; -// @ts-ignore not typed yet -// @internal export { setupUsers, DEFAULT_SUPERUSER_PASS } from './functional_tests/lib/auth'; export { readConfigFile } from './functional_test_runner/lib/config/read_config_file'; diff --git a/src/core/server/ui_settings/integration_tests/doc_exists.ts b/src/core/server/ui_settings/integration_tests/doc_exists.ts index 59c27cc13617..8710be3e02c9 100644 --- a/src/core/server/ui_settings/integration_tests/doc_exists.ts +++ b/src/core/server/ui_settings/integration_tests/doc_exists.ts @@ -12,13 +12,13 @@ export const docExistsSuite = (savedObjectsIndex: string) => () => { async function setup(options: { initialSettings?: Record } = {}) { const { initialSettings } = options; - const { uiSettings, callCluster, supertest } = getServices(); + const { uiSettings, esClient, supertest } = getServices(); // delete the kibana index to ensure we start fresh - await callCluster('deleteByQuery', { + await esClient.deleteByQuery({ index: savedObjectsIndex, + conflicts: 'proceed', body: { - conflicts: 'proceed', query: { match_all: {} }, }, refresh: true, diff --git a/src/core/server/ui_settings/integration_tests/doc_missing.ts b/src/core/server/ui_settings/integration_tests/doc_missing.ts index 29d1daf3b203..b7953cd4b25d 100644 --- a/src/core/server/ui_settings/integration_tests/doc_missing.ts +++ b/src/core/server/ui_settings/integration_tests/doc_missing.ts @@ -11,10 +11,10 @@ import { getServices, chance } from './lib'; export const docMissingSuite = (savedObjectsIndex: string) => () => { // ensure the kibana index has no documents beforeEach(async () => { - const { callCluster } = getServices(); + const { esClient } = getServices(); // delete all docs from kibana index to ensure savedConfig is not found - await callCluster('deleteByQuery', { + await esClient.deleteByQuery({ index: savedObjectsIndex, body: { query: { match_all: {} }, diff --git a/src/core/server/ui_settings/integration_tests/lib/servers.ts b/src/core/server/ui_settings/integration_tests/lib/servers.ts index d019dc640f38..b18d9926649a 100644 --- a/src/core/server/ui_settings/integration_tests/lib/servers.ts +++ b/src/core/server/ui_settings/integration_tests/lib/servers.ts @@ -7,7 +7,8 @@ */ import type supertest from 'supertest'; -import { SavedObjectsClientContract, IUiSettingsClient } from 'src/core/server'; +import type { SavedObjectsClientContract, IUiSettingsClient } from 'src/core/server'; +import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; import { createTestServers, @@ -17,7 +18,6 @@ import { HttpMethod, getSupertest, } from '../../../../test_helpers/kbn_server'; -import { LegacyAPICaller } from '../../../elasticsearch/'; import { httpServerMock } from '../../../http/http_server.mocks'; let servers: TestUtils; @@ -26,7 +26,7 @@ let kbn: TestKibanaUtils; interface AllServices { savedObjectsClient: SavedObjectsClientContract; - callCluster: LegacyAPICaller; + esClient: KibanaClient; uiSettings: IUiSettingsClient; supertest: (method: HttpMethod, path: string) => supertest.Test; } @@ -55,7 +55,7 @@ export function getServices() { return services; } - const callCluster = esServer.es.getCallCluster(); + const esClient = esServer.es.getClient(); const savedObjectsClient = kbn.coreStart.savedObjects.getScopedClient( httpServerMock.createKibanaRequest() @@ -65,7 +65,7 @@ export function getServices() { services = { supertest: (method: HttpMethod, path: string) => getSupertest(kbn.root, method, path), - callCluster, + esClient, savedObjectsClient, uiSettings, }; diff --git a/src/core/test_helpers/kbn_server.ts b/src/core/test_helpers/kbn_server.ts index dbf19f84825b..ba22ecb3b637 100644 --- a/src/core/test_helpers/kbn_server.ts +++ b/src/core/test_helpers/kbn_server.ts @@ -6,31 +6,22 @@ * Side Public License, v 1. */ -import type { KibanaClient } from '@elastic/elasticsearch/api/kibana'; import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; import { - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 - createLegacyEsTestCluster, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 + createTestEsCluster, DEFAULT_SUPERUSER_PASS, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 esTestConfig, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 kbnTestConfig, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 kibanaServerTestUser, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 kibanaTestUser, - // @ts-expect-error https://github.com/elastic/kibana/issues/95679 setupUsers, } from '@kbn/test'; -import { defaultsDeep, get } from 'lodash'; +import { defaultsDeep } from 'lodash'; import { resolve } from 'path'; import { BehaviorSubject } from 'rxjs'; import supertest from 'supertest'; import { InternalCoreSetup, InternalCoreStart } from '../server/internal_types'; -import { LegacyAPICaller } from '../server/elasticsearch'; import { CliArgs, Env } from '../server/config'; import { Root } from '../server/root'; @@ -49,15 +40,6 @@ const DEFAULTS_SETTINGS = { migrations: { skip: false }, }; -const DEFAULT_SETTINGS_WITH_CORE_PLUGINS = { - plugins: { scanDirs: [resolve(__dirname, '../../legacy/core_plugins')] }, - elasticsearch: { - hosts: [esTestConfig.getUrl()], - username: kibanaServerTestUser.username, - password: kibanaServerTestUser.password, - }, -}; - export function createRootWithSettings( settings: Record, cliArgs: Partial = {} @@ -118,6 +100,15 @@ export function createRoot(settings = {}, cliArgs: Partial = {}) { * @returns {Root} */ export function createRootWithCorePlugins(settings = {}, cliArgs: Partial = {}) { + const DEFAULT_SETTINGS_WITH_CORE_PLUGINS = { + plugins: { scanDirs: [resolve(__dirname, '../../legacy/core_plugins')] }, + elasticsearch: { + hosts: [esTestConfig.getUrl()], + username: kibanaServerTestUser.username, + password: kibanaServerTestUser.password, + }, + }; + return createRootWithSettings( defaultsDeep({}, settings, DEFAULT_SETTINGS_WITH_CORE_PLUGINS), cliArgs @@ -135,19 +126,9 @@ export const request: Record< put: (root, path) => getSupertest(root, 'put', path), }; -export interface TestElasticsearchServer { - getStartTimeout: () => number; - start: (esArgs: string[], esEnvVars: Record) => Promise; - stop: () => Promise; - cleanup: () => Promise; - getClient: () => KibanaClient; - getCallCluster: () => LegacyAPICaller; - getUrl: () => string; -} - export interface TestElasticsearchUtils { stop: () => Promise; - es: TestElasticsearchServer; + es: ReturnType; hosts: string[]; username: string; password: string; @@ -204,8 +185,8 @@ export function createTestServers({ if (!adjustTimeout) { throw new Error('adjustTimeout is required in order to avoid flaky tests'); } - const license = get(settings, 'es.license', 'basic'); - const usersToBeAdded = get(settings, 'users', []); + const license = settings.es?.license ?? 'basic'; + const usersToBeAdded = settings.users ?? []; if (usersToBeAdded.length > 0) { if (license !== 'trial') { throw new Error( @@ -223,8 +204,8 @@ export function createTestServers({ log.info('starting elasticsearch'); log.indent(4); - const es = createLegacyEsTestCluster( - defaultsDeep({}, get(settings, 'es', {}), { + const es = createTestEsCluster( + defaultsDeep({}, settings.es ?? {}, { log, license, password: license === 'trial' ? DEFAULT_SUPERUSER_PASS : undefined, @@ -236,11 +217,11 @@ export function createTestServers({ // Add time for KBN and adding users adjustTimeout(es.getStartTimeout() + 100000); - const kbnSettings: any = get(settings, 'kbn', {}); + const kbnSettings = settings.kbn ?? {}; return { startES: async () => { - await es.start(get(settings, 'es.esArgs', [])); + await es.start(); if (['gold', 'trial'].includes(license)) { await setupUsers({ @@ -249,9 +230,9 @@ export function createTestServers({ updates: [ ...usersToBeAdded, // user elastic - esTestConfig.getUrlParts(), + esTestConfig.getUrlParts() as { username: string; password: string }, // user kibana - kbnTestConfig.getUrlParts(), + kbnTestConfig.getUrlParts() as { username: string; password: string }, ], }); diff --git a/x-pack/test/functional/page_objects/security_page.ts b/x-pack/test/functional/page_objects/security_page.ts index e6f372a79f0a..2ce14fa7a251 100644 --- a/x-pack/test/functional/page_objects/security_page.ts +++ b/x-pack/test/functional/page_objects/security_page.ts @@ -5,7 +5,6 @@ * 2.0. */ -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { FtrProviderContext } from '../ftr_provider_context'; import { AuthenticatedUser, Role } from '../../../plugins/security/common/model'; diff --git a/x-pack/test/functional_cors/config.ts b/x-pack/test/functional_cors/config.ts index 42e7771b1440..81870a948dc1 100644 --- a/x-pack/test/functional_cors/config.ts +++ b/x-pack/test/functional_cors/config.ts @@ -8,7 +8,6 @@ import Url from 'url'; import Path from 'path'; import type { FtrConfigProviderContext } from '@kbn/test/types/ftr'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { kbnTestConfig } from '@kbn/test'; import { pageObjects } from '../functional/page_objects'; diff --git a/x-pack/test/functional_cors/plugins/kibana_cors_test/server/plugin.ts b/x-pack/test/functional_cors/plugins/kibana_cors_test/server/plugin.ts index e128ec6f13e7..e6c3f4b05aab 100644 --- a/x-pack/test/functional_cors/plugins/kibana_cors_test/server/plugin.ts +++ b/x-pack/test/functional_cors/plugins/kibana_cors_test/server/plugin.ts @@ -6,7 +6,6 @@ */ import Hapi from '@hapi/hapi'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { kbnTestConfig } from '@kbn/test'; import { take } from 'rxjs/operators'; import Url from 'url'; diff --git a/x-pack/test/security_api_integration/tests/anonymous/login.ts b/x-pack/test/security_api_integration/tests/anonymous/login.ts index 61c8c55c8676..30d5d3ea3312 100644 --- a/x-pack/test/security_api_integration/tests/anonymous/login.ts +++ b/x-pack/test/security_api_integration/tests/anonymous/login.ts @@ -7,7 +7,6 @@ import expect from '@kbn/expect'; import request, { Cookie } from 'request'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { FtrProviderContext } from '../../ftr_provider_context'; diff --git a/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts b/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts index c0681b5adcac..08780fdd0397 100644 --- a/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts +++ b/x-pack/test/security_api_integration/tests/kerberos/kerberos_login.ts @@ -8,7 +8,6 @@ import expect from '@kbn/expect'; import request, { Cookie } from 'request'; import { delay } from 'bluebird'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { FtrProviderContext } from '../../ftr_provider_context'; import { diff --git a/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts b/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts index 940120988b74..c0c9ebdf58ff 100644 --- a/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts +++ b/x-pack/test/security_api_integration/tests/oidc/authorization_code_flow/oidc_auth.ts @@ -9,7 +9,6 @@ import expect from '@kbn/expect'; import request, { Cookie } from 'request'; import url from 'url'; import { delay } from 'bluebird'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { getStateAndNonce } from '../../../fixtures/oidc/oidc_tools'; import { FtrProviderContext } from '../../../ftr_provider_context'; diff --git a/x-pack/test/security_api_integration/tests/pki/pki_auth.ts b/x-pack/test/security_api_integration/tests/pki/pki_auth.ts index dc2c66721f42..2150553267a7 100644 --- a/x-pack/test/security_api_integration/tests/pki/pki_auth.ts +++ b/x-pack/test/security_api_integration/tests/pki/pki_auth.ts @@ -11,7 +11,6 @@ import { delay } from 'bluebird'; import { readFileSync } from 'fs'; import { resolve } from 'path'; import { CA_CERT_PATH } from '@kbn/dev-utils'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { FtrProviderContext } from '../../ftr_provider_context'; diff --git a/x-pack/test/security_api_integration/tests/saml/saml_login.ts b/x-pack/test/security_api_integration/tests/saml/saml_login.ts index d5fb1e79f80d..a246dd4c5675 100644 --- a/x-pack/test/security_api_integration/tests/saml/saml_login.ts +++ b/x-pack/test/security_api_integration/tests/saml/saml_login.ts @@ -10,7 +10,6 @@ import url from 'url'; import { delay } from 'bluebird'; import expect from '@kbn/expect'; import request, { Cookie } from 'request'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import { getLogoutRequest, diff --git a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts index 89bb79a4761a..bb46beef4144 100644 --- a/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_idle/cleanup.ts @@ -8,7 +8,6 @@ import request, { Cookie } from 'request'; import { delay } from 'bluebird'; import expect from '@kbn/expect'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools'; diff --git a/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts b/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts index db41aca86e0b..60605c88ce45 100644 --- a/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts +++ b/x-pack/test/security_api_integration/tests/session_invalidate/invalidate.ts @@ -7,7 +7,6 @@ import request, { Cookie } from 'request'; import expect from '@kbn/expect'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools'; diff --git a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts index d2419ca07a43..0b17f037dfbd 100644 --- a/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts +++ b/x-pack/test/security_api_integration/tests/session_lifespan/cleanup.ts @@ -8,7 +8,6 @@ import request, { Cookie } from 'request'; import { delay } from 'bluebird'; import expect from '@kbn/expect'; -// @ts-expect-error https://github.com/elastic/kibana/issues/95679 import { adminTestUser } from '@kbn/test'; import type { AuthenticationProvider } from '../../../../plugins/security/common/model'; import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools';