Skip to content

Commit

Permalink
[7.x] [Search Sessions] Enable Search Sessions (#91097) (#91332)
Browse files Browse the repository at this point in the history
* [Search Sessions] Enable Search Sessions (#91097)

* enable search sessions

* adjust tests

* adjust tests

* adjust tests

* adjust tests

* make order consistent

Co-authored-by: Kibana Machine <[email protected]>

* adjust tests

that is skipped in master and also needs adjustment in master to pass with search sessions

Co-authored-by: Anton Dosov <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
3 people authored Feb 14, 2021
1 parent f03a7ea commit 04d2d39
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 29 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/data_enhanced/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const configSchema = schema.object({
/**
* Turns the feature on \ off (incl. removing indicator and management screens)
*/
enabled: schema.boolean({ defaultValue: false }),
enabled: schema.boolean({ defaultValue: true }),
/**
* pageSize controls how many search session objects we load at once while monitoring
* session completion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function registerSearchSessionsMgmt(
services.management.sections.section.kibana.registerApp({
id: APP.id,
title: APP.getI18nName(),
order: 2,
order: 1.75,
mount: async (params) => {
const { SearchSessionsMgmtApp: MgmtApp } = await import('./application');
const mgmtApp = new MgmtApp(coreSetup, config, params, services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
kibana: [
{
feature: {
discover: ['all'],
discover: ['read'],
},
spaces: ['*'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with manage_security', () => {
describe('global dashboard read with manage_security', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'manage_security'], true);
await security.testUser.setRoles(['global_dashboard_read', 'manage_security'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with ccr_user', () => {
describe('global dashboard read with ccr_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'ccr_user'], true);
await security.testUser.setRoles(['global_dashboard_read', 'ccr_user'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

it('only shows the dashboard navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link) => link.text)).to.eql(['Overview', 'Dashboard']);
expect(navLinks.map((link) => link.text)).to.eql([
'Overview',
'Dashboard',
'Stack Management', // dashboard_all enables search sessions which enables 'Stack Management'
]);
});

it(`landing page shows "Create new Dashboard" button`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

it('shows discover navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link) => link.text)).to.eql(['Overview', 'Discover']);
expect(navLinks.map((link) => link.text)).to.eql([
'Overview',
'Discover',
'Stack Management', // because `global_discover_all_role` enables search sessions
]);
});

it('shows save button', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with manage_ilm', () => {
describe('global dashboard read with manage_ilm', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'manage_ilm'], true);
await security.testUser.setRoles(['global_dashboard_read', 'manage_ilm'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with index_management_user', () => {
describe('global dashboard read with index_management_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'index_management_user'], true);
await security.testUser.setRoles(['global_dashboard_read', 'index_management_user'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
kibana: [
{
feature: {
discover: ['all'],
discover: ['read'],
},
spaces: ['*'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with ingest_pipelines_user', () => {
describe('global dashboard read with ingest_pipelines_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'ingest_pipelines_user'], true);
await security.testUser.setRoles(['global_dashboard_read', 'ingest_pipelines_user'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with license_management_user', () => {
describe('global dashboard read with license_management_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'license_management_user'], true);
await security.testUser.setRoles(
['global_dashboard_read', 'license_management_user'],
true
);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with logstash_read_user', () => {
describe('global dashboard read with logstash_read_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'logstash_read_user'], true);
await security.testUser.setRoles(['global_dashboard_read', 'logstash_read_user'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

describe('no management privileges', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all'], true);
await security.testUser.setRoles(['global_dashboard_read'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down Expand Up @@ -68,7 +68,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
expect(sections[1]).to.eql({
sectionId: 'kibana',
sectionLinks: ['indexPatterns', 'objects', 'tags', 'spaces', 'settings'],
sectionLinks: [
'indexPatterns',
'objects',
'tags',
'search_sessions',
'spaces',
'settings',
],
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with license_management_user', () => {
describe('global dashboard read with license_management_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'license_management_user'], true);
await security.testUser.setRoles(
['global_dashboard_read', 'license_management_user'],
true
);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with transform_user', () => {
describe('global dashboard read with transform_user', () => {
before(async () => {
await security.testUser.setRoles(['global_dashboard_all', 'transform_user'], true);
await security.testUser.setRoles(['global_dashboard_read', 'transform_user'], true);
});
after(async () => {
await security.testUser.restoreDefaults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});

describe('global dashboard all with global_upgrade_assistant_role', () => {
describe('global dashboard read with global_upgrade_assistant_role', () => {
before(async () => {
await security.testUser.setRoles(
['global_dashboard_all', 'global_upgrade_assistant_role'],
['global_dashboard_read', 'global_upgrade_assistant_role'],
true
);
});
Expand All @@ -60,7 +60,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
expect(links.map((link) => link.text)).to.contain('Stack Management');
});

describe('[SkipCloud] global dashboard all with global_upgrade_assistant_role', function () {
describe('[SkipCloud] global dashboard read with global_upgrade_assistant_role', function () {
this.tags('skipCloud');
it('should render the "Stack" section with Upgrde Assistant', async function () {
await PageObjects.common.navigateToApp('management');
Expand Down

0 comments on commit 04d2d39

Please sign in to comment.