From b6b1a2d5283ae7017853f2ed543d67931bc319de Mon Sep 17 00:00:00 2001 From: Rashmi Kulkarni Date: Thu, 19 Nov 2020 14:43:28 -0800 Subject: [PATCH] changes to how we load/unload data --- .../functional/apps/maps/feature_controls/maps_security.ts | 6 ------ .../functional/apps/maps/feature_controls/maps_spaces.ts | 5 +---- x-pack/test/functional/apps/maps/index.js | 4 ++++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts b/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts index 0bb1c82ff8e94..1da696c30dfb7 100644 --- a/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts +++ b/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts @@ -7,7 +7,6 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const security = getService('security'); const PageObjects = getPageObjects(['common', 'error', 'maps', 'settings', 'security']); const appsMenu = getService('appsMenu'); @@ -17,11 +16,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const savedQueryManagementComponent = getService('savedQueryManagementComponent'); describe('maps security feature controls', () => { - before(async () => { - await esArchiver.loadIfNeeded('maps/data'); - await esArchiver.load('maps/kibana'); - }); - after(async () => { // logout, so the other tests don't accidentally run as the custom users we're testing below await PageObjects.security.forceLogout(); diff --git a/x-pack/test/functional/apps/maps/feature_controls/maps_spaces.ts b/x-pack/test/functional/apps/maps/feature_controls/maps_spaces.ts index 11b87469e4993..98f91705f0c1e 100644 --- a/x-pack/test/functional/apps/maps/feature_controls/maps_spaces.ts +++ b/x-pack/test/functional/apps/maps/feature_controls/maps_spaces.ts @@ -7,7 +7,6 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const spacesService = getService('spaces'); const PageObjects = getPageObjects(['common', 'maps', 'security']); const appsMenu = getService('appsMenu'); @@ -15,13 +14,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // FLAKY: https://github.com/elastic/kibana/issues/38414 describe.skip('spaces feature controls', () => { before(async () => { - await esArchiver.loadIfNeeded('maps/data'); - await esArchiver.load('maps/kibana'); PageObjects.maps.setBasePath('/s/custom_space'); }); after(async () => { - await esArchiver.unload('maps/kibana'); + await PageObjects.security.forceLogout(); PageObjects.maps.setBasePath(''); }); diff --git a/x-pack/test/functional/apps/maps/index.js b/x-pack/test/functional/apps/maps/index.js index 2d2d2f9d3cf9b..5e6592fa2c675 100644 --- a/x-pack/test/functional/apps/maps/index.js +++ b/x-pack/test/functional/apps/maps/index.js @@ -15,6 +15,10 @@ export default function ({ loadTestFile, getService }) { before(async () => { await esArchiver.loadIfNeeded('logstash_functional'); await esArchiver.load('maps/data'); + }); + + // The data in the before() doesn't get changed inside the test, but the kibana index starting point should be the same for each individual test + beforeEach(async () => { await esArchiver.load('maps/kibana'); await kibanaServer.uiSettings.replace({ defaultIndex: 'c698b940-e149-11e8-a35a-370a8516603a',