mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Unskip download csv permissions test (#173660)
## Summary close https://github.com/elastic/kibana/issues/172599 I couldn't reproduce the failure, looks like it is very rare. But when reviewing the code I noticed possible race conditions and refactored. Suggest we merge the refactor and observe. Before fix https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4647 100x passed - means flakiness hard to reproduce After fix https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4649 50x passed - still stable
This commit is contained in:
parent
4f186d0cc5
commit
7fe9faea3c
2 changed files with 16 additions and 30 deletions
|
@ -44,12 +44,10 @@ export class ReportingCsvPanelAction implements ActionDefinition<ActionContext>
|
|||
private isDownloading: boolean;
|
||||
public readonly type = '';
|
||||
public readonly id = CSV_REPORTING_ACTION;
|
||||
private licenseHasDownloadCsv: boolean = false;
|
||||
private capabilityHasDownloadCsv: boolean = false;
|
||||
private notifications: NotificationsSetup;
|
||||
private apiClient: ReportingAPIClient;
|
||||
private startServices$: Params['startServices$'];
|
||||
private usesUiCapabilities: any;
|
||||
private readonly notifications: NotificationsSetup;
|
||||
private readonly apiClient: ReportingAPIClient;
|
||||
private readonly startServices$: Params['startServices$'];
|
||||
private readonly usesUiCapabilities: boolean;
|
||||
|
||||
constructor({ core, apiClient, startServices$, usesUiCapabilities }: Params) {
|
||||
this.isDownloading = false;
|
||||
|
@ -78,34 +76,23 @@ export class ReportingCsvPanelAction implements ActionDefinition<ActionContext>
|
|||
}
|
||||
|
||||
public isCompatible = async (context: ActionContext) => {
|
||||
await new Promise<void>((resolve) => {
|
||||
this.startServices$.subscribe(([{ application }, { licensing }]) => {
|
||||
licensing.license$.subscribe((license) => {
|
||||
const results = license.check('reporting', 'basic');
|
||||
const { showLinks } = checkLicense(results);
|
||||
this.licenseHasDownloadCsv = showLinks;
|
||||
});
|
||||
|
||||
if (this.usesUiCapabilities) {
|
||||
this.capabilityHasDownloadCsv = application.capabilities.dashboard?.downloadCsv === true;
|
||||
} else {
|
||||
this.capabilityHasDownloadCsv = true; // deprecated
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
if (!this.licenseHasDownloadCsv || !this.capabilityHasDownloadCsv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { embeddable } = context;
|
||||
|
||||
if (embeddable.type !== 'search') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const [{ application }, { licensing }] = await firstValueFrom(this.startServices$);
|
||||
const license = await firstValueFrom(licensing.license$);
|
||||
const licenseHasDownloadCsv = checkLicense(license.check('reporting', 'basic')).showLinks;
|
||||
const capabilityHasDownloadCsv = this.usesUiCapabilities
|
||||
? application.capabilities.dashboard?.downloadCsv === true
|
||||
: true; // deprecated
|
||||
|
||||
if (!licenseHasDownloadCsv || !capabilityHasDownloadCsv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const savedSearch = embeddable.getSavedSearch();
|
||||
const query = savedSearch?.searchSource.getField('query');
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ const CANVAS_TITLE = 'The Very Cool Workpad for PDF Tests';
|
|||
export default function ({ getService }: FtrProviderContext) {
|
||||
const reportingFunctional = getService('reportingFunctional');
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/172599
|
||||
describe.skip('Security with `reporting_user` built-in role', () => {
|
||||
describe('Security with `reporting_user` built-in role', () => {
|
||||
before(async () => {
|
||||
await reportingFunctional.initEcommerce();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue