diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/setup.ts b/x-pack/test/alerting_api_integration/security_and_spaces/setup.ts index 69ca58e1edc12..74dcdc3989e2a 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/setup.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/setup.ts @@ -39,7 +39,7 @@ export async function setupSpacesAndUsers(getService: FtrProviderContext['getSer export async function tearDown(getService: FtrProviderContext['getService']) { const securityService = getService('security'); - const esArchiver = getService('esArchiver'); + const spacesService = getService('spaces'); for (const user of Users) { await securityService.user.delete(user.username); @@ -52,5 +52,7 @@ export async function tearDown(getService: FtrProviderContext['getService']) { } } - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + for (const space of Spaces) { + await spacesService.delete(space.id); + } } diff --git a/x-pack/test/api_integration/apis/metrics_ui/log_entry_highlights.ts b/x-pack/test/api_integration/apis/metrics_ui/log_entry_highlights.ts index bd9a9a0e7c480..aba182274c9a3 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/log_entry_highlights.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/log_entry_highlights.ts @@ -37,6 +37,7 @@ const COMMON_HEADERS = { export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); + const kibanaServer = getService('kibanaServer'); describe('log highlight apis', () => { before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/simple_logs')); @@ -44,8 +45,8 @@ export default function ({ getService }: FtrProviderContext) { describe('/log_entries/highlights', () => { describe('with the default source', () => { - before(() => esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); - after(() => esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana')); + before(() => kibanaServer.savedObjects.cleanStandardList()); + after(() => kibanaServer.savedObjects.cleanStandardList()); it('Handles empty responses', async () => { const { body } = await supertest diff --git a/x-pack/test/api_integration/apis/metrics_ui/sources.ts b/x-pack/test/api_integration/apis/metrics_ui/sources.ts index 0ba6f49634b54..c58b332c7102f 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/sources.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/sources.ts @@ -18,6 +18,7 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertest = getService('supertest'); const SOURCE_API_URL = '/api/metrics/source/default'; + const kibanaServer = getService('kibanaServer'); const patchRequest = async ( body: PartialMetricsSourceConfigurationProperties ): Promise => { @@ -32,8 +33,8 @@ export default function ({ getService }: FtrProviderContext) { describe('sources', () => { before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs')); after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs')); - beforeEach(() => esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); - afterEach(() => esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana')); + before(() => kibanaServer.savedObjects.cleanStandardList()); + after(() => kibanaServer.savedObjects.cleanStandardList()); describe('patch request', () => { it('applies all top-level field updates to an existing source', async () => { diff --git a/x-pack/test/api_integration/apis/ml/modules/index.ts b/x-pack/test/api_integration/apis/ml/modules/index.ts index 182de3e2648cb..de8919976fd33 100644 --- a/x-pack/test/api_integration/apis/ml/modules/index.ts +++ b/x-pack/test/api_integration/apis/ml/modules/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, loadTestFile }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const ml = getService('ml'); const fleetPackages = ['apache', 'nginx']; @@ -16,8 +16,8 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { describe('modules', function () { before(async () => { - // use empty_kibana to make sure the fleet setup is removed correctly after the tests - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + // use await kibanaServer.savedObjects.cleanStandardList(); to make sure the fleet setup is removed correctly after the tests + await kibanaServer.savedObjects.cleanStandardList(); // Fleet need to be setup to be able to setup packages await ml.testResources.setupFleet(); @@ -32,7 +32,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { for (const fleetPackage of installedPackages) { await ml.testResources.removeFleetPackage(fleetPackage.pkgName, fleetPackage.version); } - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); loadTestFile(require.resolve('./get_module')); diff --git a/x-pack/test/api_integration/apis/osquery/packs.ts b/x-pack/test/api_integration/apis/osquery/packs.ts index 840d5aecaeae0..dc019bffeec6f 100644 --- a/x-pack/test/api_integration/apis/osquery/packs.ts +++ b/x-pack/test/api_integration/apis/osquery/packs.ts @@ -50,13 +50,13 @@ export default function ({ getService }: FtrProviderContext) { let hostedPolicy: Record; let packagePolicyId: string; before(async () => { - await getService('esArchiver').load('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); await getService('esArchiver').load( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); }); after(async () => { - await getService('esArchiver').unload('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); await getService('esArchiver').unload( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); diff --git a/x-pack/test/api_integration/apis/security_solution/saved_objects/notes.ts b/x-pack/test/api_integration/apis/security_solution/saved_objects/notes.ts index 03ea91775d1bf..a6dc1f88c596e 100644 --- a/x-pack/test/api_integration/apis/security_solution/saved_objects/notes.ts +++ b/x-pack/test/api_integration/apis/security_solution/saved_objects/notes.ts @@ -10,12 +10,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const supertest = getService('supertest'); describe('Note - Saved Objects', () => { - beforeEach(() => esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); - afterEach(() => esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana')); + before(() => kibanaServer.savedObjects.cleanStandardList()); + after(() => kibanaServer.savedObjects.cleanStandardList()); describe('create a note', () => { it('should return a timelineId, timelineVersion, noteId and version', async () => { diff --git a/x-pack/test/api_integration/apis/security_solution/saved_objects/pinned_events.ts b/x-pack/test/api_integration/apis/security_solution/saved_objects/pinned_events.ts index 8391f2f9ab18a..dcfe8a109b04e 100644 --- a/x-pack/test/api_integration/apis/security_solution/saved_objects/pinned_events.ts +++ b/x-pack/test/api_integration/apis/security_solution/saved_objects/pinned_events.ts @@ -10,12 +10,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const supertest = getService('supertest'); describe('Pinned Events - Saved Objects', () => { - beforeEach(() => esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); - afterEach(() => esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana')); + before(() => kibanaServer.savedObjects.cleanStandardList()); + after(() => kibanaServer.savedObjects.cleanStandardList()); describe('Pinned an event', () => { it('return a timelineId, timelineVersion, pinnedEventId and version', async () => { diff --git a/x-pack/test/api_integration/apis/security_solution/saved_objects/timeline.ts b/x-pack/test/api_integration/apis/security_solution/saved_objects/timeline.ts index 32d307ebc22d5..e3a79ba91b29c 100644 --- a/x-pack/test/api_integration/apis/security_solution/saved_objects/timeline.ts +++ b/x-pack/test/api_integration/apis/security_solution/saved_objects/timeline.ts @@ -12,12 +12,12 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { createBasicTimeline } from './helpers'; export default function ({ getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const supertest = getService('supertest'); describe('Timeline - Saved Objects', () => { - beforeEach(() => esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); - afterEach(() => esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana')); + beforeEach(() => kibanaServer.savedObjects.cleanStandardList()); + afterEach(() => kibanaServer.savedObjects.cleanStandardList()); describe('Persist a timeline', () => { it('Create a timeline just with a title', async () => { diff --git a/x-pack/test/common/services/spaces.ts b/x-pack/test/common/services/spaces.ts index 24554e151135c..c023d8da26ba5 100644 --- a/x-pack/test/common/services/spaces.ts +++ b/x-pack/test/common/services/spaces.ts @@ -24,7 +24,7 @@ export function SpacesServiceProvider({ getService }: FtrProviderContext) { return new (class SpacesService { public async create(space: any) { - log.debug('creating space'); + log.debug(`creating space ${space.name}`); const { data, status, statusText } = await axios.post('/api/spaces/space', space); if (status !== 200) { @@ -32,19 +32,19 @@ export function SpacesServiceProvider({ getService }: FtrProviderContext) { `Expected status code of 200, received ${status} ${statusText}: ${util.inspect(data)}` ); } - log.debug('created space'); + log.debug(`created space ${space}`); } public async delete(spaceId: string) { - log.debug(`deleting space: ${spaceId}`); + log.debug(`deleting space id: ${spaceId}`); const { data, status, statusText } = await axios.delete(`/api/spaces/space/${spaceId}`); if (status !== 204) { - throw new Error( + log.debug( `Expected status code of 204, received ${status} ${statusText}: ${util.inspect(data)}` ); } - log.debug(`deleted space: ${spaceId}`); + log.debug(`deleted space id: ${spaceId}`); } })(); } diff --git a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts index 6641867cadf22..e71c14a8054c8 100644 --- a/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts +++ b/x-pack/test/fleet_api_integration/apis/agent_policy/agent_policy.ts @@ -23,7 +23,7 @@ export default function (providerContext: FtrProviderContext) { let systemPkgVersion: string; before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); setupFleetAndAgents(providerContext); let packagePoliciesToDeleteIds: string[] = []; @@ -41,7 +41,7 @@ export default function (providerContext: FtrProviderContext) { } await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); it('should work with valid minimum required values', async () => { const { diff --git a/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts b/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts index 4e5d2c60ae932..c48f5602f5b52 100644 --- a/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts +++ b/x-pack/test/fleet_api_integration/apis/download_sources/crud.ts @@ -14,11 +14,12 @@ export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('fleet_download_sources_crud', async function () { skipIfNoDockerRegistry(providerContext); before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); setupFleetAndAgents(providerContext); @@ -38,7 +39,7 @@ export default function (providerContext: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts index 9a49958d31d34..8906a7fa3ea37 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts @@ -13,10 +13,10 @@ import { setupFleetAndAgents } from '../agents/services'; export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); const pkgName = 'error_handling'; const goodPackageVersion = '0.1.0'; const badPackageVersion = '0.2.0'; + const kibanaServer = getService('kibanaServer'); const installPackage = async (pkg: string, version: string) => { await supertest @@ -33,10 +33,10 @@ export default function (providerContext: FtrProviderContext) { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); beforeEach(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); afterEach(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); it('on a fresh install, it should uninstall a broken package during rollback', async function () { diff --git a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts index 88368e784dfa6..d1e7cd8d999c6 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts @@ -14,20 +14,21 @@ export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); let agentCount = 0; let pkgVersion: string; describe('fleet_telemetry', () => { skipIfNoDockerRegistry(providerContext); before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); setupFleetAndAgents(providerContext); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); if (pkgVersion) { await supertest.delete(`/api/fleet/epm/packages/fleet_server/${pkgVersion}`); diff --git a/x-pack/test/fleet_api_integration/apis/outputs/crud.ts b/x-pack/test/fleet_api_integration/apis/outputs/crud.ts index 43a3707a21963..f48e17a704504 100644 --- a/x-pack/test/fleet_api_integration/apis/outputs/crud.ts +++ b/x-pack/test/fleet_api_integration/apis/outputs/crud.ts @@ -14,11 +14,12 @@ export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('fleet_output_crud', async function () { skipIfNoDockerRegistry(providerContext); before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); setupFleetAndAgents(providerContext); @@ -37,7 +38,7 @@ export default function (providerContext: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/create.ts b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts index c16815eee3168..46f716e132246 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/create.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts @@ -14,6 +14,7 @@ export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const es: Client = getService('es'); const supertest = getService('supertest'); + const kibanaServer = getService('kibanaServer'); const getPackagePolicyById = async (id: string) => { const { body } = await supertest.get(`/api/fleet/package_policies/${id}`); @@ -27,13 +28,13 @@ export default function (providerContext: FtrProviderContext) { skipIfNoDockerRegistry(providerContext); let agentPolicyId: string; before(async () => { - await getService('esArchiver').load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await getService('esArchiver').load( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); }); after(async () => { - await getService('esArchiver').unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await getService('esArchiver').unload( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/get.ts b/x-pack/test/fleet_api_integration/apis/package_policy/get.ts index ef9eee7542838..dbfb8109a2c19 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/get.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/get.ts @@ -23,7 +23,8 @@ export default function (providerContext: FtrProviderContext) { skipIfNoDockerRegistry(providerContext); before(async () => { - await getService('esArchiver').load('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); + await getService('esArchiver').load( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); @@ -33,7 +34,7 @@ export default function (providerContext: FtrProviderContext) { await getService('esArchiver').unload( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); - await getService('esArchiver').unload('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); }); describe('get by id', async function () { diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts b/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts index 6486579f41c73..4a113714dc324 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts @@ -17,6 +17,7 @@ export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); function withTestPackageVersion(version: string) { before(async function () { @@ -42,12 +43,12 @@ export default function (providerContext: FtrProviderContext) { let packagePolicyId: string; before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); after(async () => { - await getService('esArchiver').unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await getService('esArchiver').unload( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); diff --git a/x-pack/test/fleet_api_integration/apis/preconfiguration/preconfiguration.ts b/x-pack/test/fleet_api_integration/apis/preconfiguration/preconfiguration.ts index ee7679d2cef65..83d2913e7aa59 100644 --- a/x-pack/test/fleet_api_integration/apis/preconfiguration/preconfiguration.ts +++ b/x-pack/test/fleet_api_integration/apis/preconfiguration/preconfiguration.ts @@ -21,7 +21,8 @@ export default function (providerContext: FtrProviderContext) { describe('Preconfiguration', async () => { skipIfNoDockerRegistry(providerContext); before(async () => { - await getService('esArchiver').load('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); + await getService('esArchiver').load( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); @@ -31,7 +32,7 @@ export default function (providerContext: FtrProviderContext) { await getService('esArchiver').unload( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ); - await getService('esArchiver').unload('x-pack/test/functional/es_archives/empty_kibana'); + await getService('kibanaServer').savedObjects.cleanStandardList(); }); // Basic health check for the API; functionality is covered by the unit tests diff --git a/x-pack/test/fleet_api_integration/apis/service_tokens.ts b/x-pack/test/fleet_api_integration/apis/service_tokens.ts index e668caab8e98f..bd13c3f5b8ca8 100644 --- a/x-pack/test/fleet_api_integration/apis/service_tokens.ts +++ b/x-pack/test/fleet_api_integration/apis/service_tokens.ts @@ -11,16 +11,16 @@ import { FtrProviderContext } from '../../api_integration/ftr_provider_context'; export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const esClient = getService('es'); describe('fleet_service_tokens', async () => { before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('POST /api/fleet/service_tokens', () => { diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts index 142f6af984994..5b10de7b3e036 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts @@ -6,7 +6,6 @@ */ import expect from '@kbn/expect'; -import { EsArchiver } from '@kbn/es-archiver'; import { AppSearchService, IEngine } from '../../../../services/app_search_service'; import { Browser } from '../../../../../../../test/functional/services/common'; import { FtrProviderContext } from '../../../../ftr_provider_context'; @@ -15,11 +14,10 @@ export default function enterpriseSearchSetupEnginesTests({ getService, getPageObjects, }: FtrProviderContext) { - const esArchiver = getService('esArchiver') as EsArchiver; const browser = getService('browser') as Browser; const retry = getService('retry'); const appSearch = getService('appSearch') as AppSearchService; - + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['appSearch', 'security']); describe('Engines Overview', function () { @@ -28,14 +26,14 @@ export default function enterpriseSearchSetupEnginesTests({ let metaEngine: IEngine; before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); engine1 = await appSearch.createEngine(); engine2 = await appSearch.createEngine(); metaEngine = await appSearch.createMetaEngine([engine1.name, engine2.name]); }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); appSearch.destroyEngine(engine1.name); appSearch.destroyEngine(engine2.name); appSearch.destroyEngine(metaEngine.name); diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts index e7bec22936d12..2995150d73d07 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts @@ -12,16 +12,17 @@ export default function enterpriseSearchSetupGuideTests({ getService, getPageObjects, }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const browser = getService('browser'); const retry = getService('retry'); - + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['appSearch']); describe('Setup Guide', function () { - before(async () => await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('when no enterpriseSearch.host is configured', () => { diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts index e1e78885e6401..0be3156d29c02 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts @@ -12,16 +12,17 @@ export default function enterpriseSearchSetupGuideTests({ getService, getPageObjects, }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const browser = getService('browser'); const retry = getService('retry'); - + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['workplaceSearch']); describe('Setup Guide', function () { - before(async () => await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana')); + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('when no enterpriseSearch.host is configured', () => { diff --git a/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts b/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts index a7bcdf2ddc52c..961efb82a90d1 100644 --- a/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts +++ b/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts @@ -21,6 +21,7 @@ export default function ({ getService }: FtrProviderContext) { const retry = getService('retry'); const spacesService = getService('spaces'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('Event Log public API', () => { before(async () => { @@ -32,7 +33,7 @@ export default function ({ getService }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); for (const namespace of [undefined, 'namespace-a']) { diff --git a/x-pack/test/reporting_functional/reporting_without_security/management.ts b/x-pack/test/reporting_functional/reporting_without_security/management.ts index 36589d375b0e0..f9444c7e4c729 100644 --- a/x-pack/test/reporting_functional/reporting_without_security/management.ts +++ b/x-pack/test/reporting_functional/reporting_without_security/management.ts @@ -40,7 +40,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const supertest = getService('supertestWithoutAuth'); const kibanaServer = getService('kibanaServer'); const testSubjects = getService('testSubjects'); - const esArchiver = getService('esArchiver'); const reportingApi = getService('reportingAPI'); const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json'; @@ -55,12 +54,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { describe('Polling for jobs', () => { beforeEach(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.load(ecommerceSOPath); }); afterEach(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.importExport.unload(ecommerceSOPath); await reportingApi.deleteAllReports(); }); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_telemetry.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_telemetry.ts index efc87330eb822..3dc4f9fb3f3a4 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_telemetry.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_telemetry.ts @@ -11,17 +11,18 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const telemetryTestResources = getService('telemetryTestResources'); + const kibanaServer = getService('kibanaServer'); // The source of the data for these tests have changed and need to be updated // There are currently tests in the security_solution application being maintained describe.skip('security solution endpoint telemetry', () => { after(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('when no agents are connected', () => { before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); it('reports no endpoints or policies', async () => { diff --git a/x-pack/test/visual_regression/tests/login_page.ts b/x-pack/test/visual_regression/tests/login_page.ts index 34e1132134744..3e2b410024036 100644 --- a/x-pack/test/visual_regression/tests/login_page.ts +++ b/x-pack/test/visual_regression/tests/login_page.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const visualTesting = getService('visualTesting'); const testSubjects = getService('testSubjects'); const retry = getService('retry'); @@ -17,12 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe.skip('Security', () => { describe('Login Page', () => { before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); await PageObjects.security.forceLogout(); }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); + await kibanaServer.savedObjects.cleanStandardList(); }); afterEach(async () => {