Replacing es_archives/reporting/ecommerce_kibana with kbn_archiver/reporting/ecommerce.json as part of migrating to kbn_archiver (#102825)

This commit is contained in:
Bhavya RM 2021-06-22 19:16:53 -04:00 committed by GitHub
parent 4fa3dc46cb
commit 859b453752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 709 additions and 3541 deletions

View file

@ -17,10 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const log = getService('log'); const log = getService('log');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
const filterBar = getService('filterBar'); const filterBar = getService('filterBar');
const find = getService('find'); const find = getService('find');
const retry = getService('retry'); const retry = getService('retry');
const PageObjects = getPageObjects(['reporting', 'common', 'dashboard', 'timePicker']); const PageObjects = getPageObjects(['reporting', 'common', 'dashboard', 'timePicker']);
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
const getCsvPath = (name: string) => const getCsvPath = (name: string) =>
path.resolve(REPO_ROOT, `target/functional-tests/downloads/${name}.csv`); path.resolve(REPO_ROOT, `target/functional-tests/downloads/${name}.csv`);
@ -67,11 +69,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('E-Commerce Data', () => { describe('E-Commerce Data', () => {
before(async () => { before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
}); });
after(async () => { after(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
}); });
it('Download CSV export of a saved search panel', async function () { it('Download CSV export of a saved search panel', async function () {

View file

@ -27,13 +27,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const es = getService('es'); const es = getService('es');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
describe('Dashboard Reporting Screenshots', () => { // https://github.com/elastic/kibana/issues/102911
describe.skip('Dashboard Reporting Screenshots', () => {
before('initialize tests', async () => { before('initialize tests', async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.loadIfNeeded( await kibanaServer.importExport.load(ecommerceSOPath);
'x-pack/test/functional/es_archives/reporting/ecommerce_kibana'
);
await browser.setWindowSize(1600, 850); await browser.setWindowSize(1600, 850);
await security.role.create('test_reporting_user', { await security.role.create('test_reporting_user', {
@ -61,7 +61,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
}); });
after('clean up archives', async () => { after('clean up archives', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await es.deleteByQuery({ await es.deleteByQuery({
index: '.reporting-*', index: '.reporting-*',
refresh: true, refresh: true,

View file

@ -16,6 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser'); const browser = getService('browser');
const PageObjects = getPageObjects(['reporting', 'common', 'discover', 'timePicker']); const PageObjects = getPageObjects(['reporting', 'common', 'discover', 'timePicker']);
const filterBar = getService('filterBar'); const filterBar = getService('filterBar');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
const setFieldsFromSource = async (setValue: boolean) => { const setFieldsFromSource = async (setValue: boolean) => {
await kibanaServer.uiSettings.update({ 'discover:searchFieldsFromSource': setValue }); await kibanaServer.uiSettings.update({ 'discover:searchFieldsFromSource': setValue });
@ -25,12 +26,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before('initialize tests', async () => { before('initialize tests', async () => {
log.debug('ReportingPage:initTests'); log.debug('ReportingPage:initTests');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
await browser.setWindowSize(1600, 850); await browser.setWindowSize(1600, 850);
}); });
after('clean up archives', async () => { after('clean up archives', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await es.deleteByQuery({ await es.deleteByQuery({
index: '.reporting-*', index: '.reporting-*',
refresh: true, refresh: true,
@ -74,7 +75,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('Generate CSV: new search', () => { describe('Generate CSV: new search', () => {
beforeEach(async () => { beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); // reload the archive to wipe out changes made by each test await kibanaServer.importExport.load(ecommerceSOPath);
await PageObjects.common.navigateToApp('discover'); await PageObjects.common.navigateToApp('discover');
}); });
@ -151,12 +152,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => { before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
}); });
after(async () => { after(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
}); });
beforeEach(() => PageObjects.common.navigateToApp('discover')); beforeEach(() => PageObjects.common.navigateToApp('discover'));

View file

@ -16,16 +16,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dataGrid = getService('dataGrid'); const dataGrid = getService('dataGrid');
const panelActions = getService('dashboardPanelActions'); const panelActions = getService('dashboardPanelActions');
const panelActionsTimeRange = getService('dashboardPanelTimeRange'); const panelActionsTimeRange = getService('dashboardPanelTimeRange');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
describe('Discover Saved Searches', () => { describe('Discover Saved Searches', () => {
before('initialize tests', async () => { before('initialize tests', async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
await kibanaServer.uiSettings.update({ 'doc_table:legacy': false }); await kibanaServer.uiSettings.update({ 'doc_table:legacy': false });
}); });
after('clean up archives', async () => { after('clean up archives', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await kibanaServer.uiSettings.unset('doc_table:legacy'); await kibanaServer.uiSettings.unset('doc_table:legacy');
}); });

View file

@ -13,6 +13,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const browser = getService('browser'); const browser = getService('browser');
const log = getService('log'); const log = getService('log');
const kibanaServer = getService('kibanaServer');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
const PageObjects = getPageObjects([ const PageObjects = getPageObjects([
'reporting', 'reporting',
'common', 'common',
@ -25,14 +28,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before('initialize tests', async () => { before('initialize tests', async () => {
log.debug('ReportingPage:initTests'); log.debug('ReportingPage:initTests');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.loadIfNeeded( await kibanaServer.importExport.load(ecommerceSOPath);
'x-pack/test/functional/es_archives/reporting/ecommerce_kibana'
);
await browser.setWindowSize(1600, 850); await browser.setWindowSize(1600, 850);
}); });
after('clean up archives', async () => { after('clean up archives', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await es.deleteByQuery({ await es.deleteByQuery({
index: '.reporting-*', index: '.reporting-*',
refresh: true, refresh: true,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -22,8 +22,10 @@ export function createScenarios({ getService }: Pick<FtrProviderContext, 'getSer
const log = getService('log'); const log = getService('log');
const supertest = getService('supertest'); const supertest = getService('supertest');
const esSupertest = getService('esSupertest'); const esSupertest = getService('esSupertest');
const kibanaServer = getService('kibanaServer');
const supertestWithoutAuth = getService('supertestWithoutAuth'); const supertestWithoutAuth = getService('supertestWithoutAuth');
const retry = getService('retry'); const retry = getService('retry');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
const DATA_ANALYST_USERNAME = 'data_analyst'; const DATA_ANALYST_USERNAME = 'data_analyst';
const DATA_ANALYST_PASSWORD = 'data_analyst-password'; const DATA_ANALYST_PASSWORD = 'data_analyst-password';
@ -32,11 +34,11 @@ export function createScenarios({ getService }: Pick<FtrProviderContext, 'getSer
const initEcommerce = async () => { const initEcommerce = async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
}; };
const teardownEcommerce = async () => { const teardownEcommerce = async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce'); await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await deleteAllReports(); await deleteAllReports();
}; };

View file

@ -14,10 +14,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const PageObjects = getPageObjects(['common', 'reporting']); const PageObjects = getPageObjects(['common', 'reporting']);
const log = getService('log'); const log = getService('log');
const supertest = getService('supertestWithoutAuth'); const supertest = getService('supertestWithoutAuth');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const reportingApi = getService('reportingAPI'); const reportingApi = getService('reportingAPI');
const ecommerceSOPath = 'x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json';
const postJobJSON = async ( const postJobJSON = async (
apiPath: string, apiPath: string,
@ -31,12 +32,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
describe('Polling for jobs', () => { describe('Polling for jobs', () => {
beforeEach(async () => { beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.load(ecommerceSOPath);
}); });
afterEach(async () => { afterEach(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana');
await esArchiver.unload('x-pack/test/functional/es_archives/reporting/ecommerce_kibana'); await kibanaServer.importExport.unload(ecommerceSOPath);
await reportingApi.deleteAllReports(); await reportingApi.deleteAllReports();
}); });