forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting] Move error_code to output (elastic#126044)
* move error_code to output * first version of api integration test for error_code * clean up old error_code field and make exisint one optional * use correct mapping format * fix api integration test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
23f00c6
commit 9037839
Showing
8 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
x-pack/test/reporting_api_integration/reporting_and_security/error_codes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { ReportApiJSON } from '../../../plugins/reporting/common/types'; | ||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ getService }: FtrProviderContext) { | ||
const reportingAPI = getService('reportingAPI'); | ||
|
||
describe('Reporting error codes', () => { | ||
it('places error_code in report output', async () => { | ||
await reportingAPI.initEcommerce(); | ||
|
||
const { body: reportApiJson, status } = await reportingAPI.generateCsv({ | ||
title: 'CSV Report', | ||
browserTimezone: 'UTC', | ||
objectType: 'search', | ||
version: '7.15.0', | ||
searchSource: null, // Invalid searchSource that should cause job to throw at execute phase... | ||
} as any); | ||
expect(status).to.be(200); | ||
|
||
const { job: report, path: downloadPath } = reportApiJson as { | ||
job: ReportApiJSON; | ||
path: string; | ||
}; | ||
|
||
// wait for the the pending job to complete | ||
await reportingAPI.waitForJobToFinish(downloadPath, true); | ||
|
||
expect(await reportingAPI.getJobErrorCode(report.id)).to.be('unknown_error'); | ||
|
||
await reportingAPI.teardownEcommerce(); | ||
await reportingAPI.deleteAllReports(); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters