Skip to content

Commit

Permalink
[Archive Migration][Partial] discover apps-management (#110444)
Browse files Browse the repository at this point in the history
* [Archive Migration][Partial] discover apps-management

Comes from #102827

Helps with #108503

Only include the changes under the
test/functional/apps/management folder.

* Remove the index pattern, that the test
creates.

* Drop beforeEach(), in favour of before(),
since there's only one test.

* Drop outdated comment,
drop these three cleanup lines
as the unload should handle it.

* Just keep one cleanup.

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
wayneseymour and kibanamachine authored Sep 15, 2021
1 parent 238c61d commit 50eb5d9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 26 deletions.
6 changes: 2 additions & 4 deletions test/functional/apps/management/_field_formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { FIELD_FORMAT_IDS } from '../../../../src/plugins/field_formats/common';
import { WebElementWrapper } from '../../services/lib/web_element_wrapper';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const browser = getService('browser');
const PageObjects = getPageObjects(['settings', 'common']);
Expand All @@ -32,13 +31,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 PageObjects.settings.navigateTo();
await esArchiver.emptyKibanaIndex();
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
});

describe('set and change field formatter', function describeIndexTests() {
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
1 change: 1 addition & 0 deletions test/functional/apps/management/_index_patterns_empty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
path: '/logstash-a',
method: 'DELETE',
});
await kibanaServer.savedObjects.clean({ types: ['index-pattern'] });
});

// create index pattern and return to verify list
Expand Down
12 changes: 6 additions & 6 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,21 @@ 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');
before(async () => {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.settings.navigateTo();
});

afterEach(async function () {
await esArchiver.unload('test/functional/fixtures/es_archiver/discover');
after(async () => {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.savedObjects.clean({ types: ['search', 'visualization'] });
});

it('should import saved objects mgmt', async function () {
Expand Down
9 changes: 2 additions & 7 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,16 +22,12 @@ export default function ({ getService, getPageObjects }) {

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

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

describe('create runtime field', function describeIndexTests() {
Expand Down
11 changes: 4 additions & 7 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,16 +45,14 @@ export default function ({ getService, getPageObjects }) {

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

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

it('should not allow saving of invalid scripts', async function () {
Expand Down Expand Up @@ -125,7 +122,7 @@ export default function ({ getService, getPageObjects }) {
'painless',
'number',
null,
'1',
'100',
script
);
await retry.try(async function () {
Expand Down

0 comments on commit 50eb5d9

Please sign in to comment.