Skip to content

Commit

Permalink
[Archive Migration][Partial] discover apps-management
Browse files Browse the repository at this point in the history
Comes from #102827

Helps with #108503

Piggy back off of the work from @tylersmalley
Only include the changes under the
test/functional/apps/management folder.
  • Loading branch information
wayneseymour committed Aug 30, 2021
1 parent 57dc0c1 commit 05c1277
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion test/functional/apps/management/_field_formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'test_field_formatters',
'test_logstash_reader',
]);
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
});

after(async function afterAll() {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.settings.navigateTo();
await esArchiver.emptyKibanaIndex();
});
Expand Down
8 changes: 6 additions & 2 deletions test/functional/apps/management/_handle_version_conflict.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import expect from '@kbn/expect';

export default function ({ getService, getPageObjects }) {
const testSubjects = getService('testSubjects');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const browser = getService('browser');
const es = getService('es');
const retry = getService('retry');
Expand All @@ -30,7 +30,11 @@ export default function ({ getService, getPageObjects }) {
describe('index version conflict', function describeIndexTests() {
before(async function () {
await browser.setWindowSize(1200, 800);
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
});

after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});

it('Should be able to surface version conflict notification while creating scripted field', async function () {
Expand Down
16 changes: 9 additions & 7 deletions test/functional/apps/management/_mgmt_import_saved_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ import expect from '@kbn/expect';
import path from 'path';

export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'settings', 'header', 'savedObjects']);

//in 6.4.0 bug the Saved Search conflict would be resolved and get imported but the visualization
//that referenced the saved search was not imported.( https://github.com/elastic/kibana/issues/22238)

describe('mgmt saved objects', function describeIndexTests() {
beforeEach(async function () {
await esArchiver.emptyKibanaIndex();
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
await PageObjects.settings.navigateTo();
before(async () => {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
});

after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});

afterEach(async function () {
await esArchiver.unload('test/functional/fixtures/es_archiver/discover');
beforeEach(async function () {
await PageObjects.settings.navigateTo();
});

it('should import saved objects mgmt', async function () {
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/management/_runtime_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import expect from '@kbn/expect';

export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const log = getService('log');
const browser = getService('browser');
Expand All @@ -23,13 +22,14 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
await browser.setWindowSize(1200, 800);
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
// delete .kibana index and then wait for Kibana to re-create it
await kibanaServer.uiSettings.replace({});
await kibanaServer.uiSettings.update({});
});

after(async function afterAll() {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.removeLogstashIndexPatternIfExist();
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/management/_scripted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import expect from '@kbn/expect';

export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const log = getService('log');
const browser = getService('browser');
Expand All @@ -46,13 +45,14 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
await browser.setWindowSize(1200, 800);
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
// delete .kibana index and then wait for Kibana to re-create it
await kibanaServer.uiSettings.replace({});
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
});

after(async function afterAll() {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.removeLogstashIndexPatternIfExist();
Expand Down

0 comments on commit 05c1277

Please sign in to comment.