-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Reporting] Re-enable some skipped tests #27094
Merged
tsullivan
merged 8 commits into
elastic:master
from
tsullivan:reporting/test-re-enable-ii
Dec 14, 2018
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d9f89f8
[Test/Reporting] Enable "generates a report with/without data"
tsullivan 66cd562
navigate to discover before each csv test
tsullivan 82aeb21
get another test working
tsullivan c28a288
re-enable more tests
tsullivan e30f3c4
refactor api usage tests
tsullivan fce5d93
catch error in createIndex to avoid race condition in test
tsullivan 9db7672
Merge branch 'master' into reporting/test-re-enable-ii
tsullivan 2d1ec6d
delete reports before
tsullivan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,10 @@ export default function ({ getService }) { | |
const usageAPI = getService('usageAPI'); | ||
|
||
describe('reporting usage', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice cleanup here |
||
before(async () => { | ||
await reportingAPI.deleteAllReportingIndexes(); | ||
}); | ||
before(() => reportingAPI.deleteAllReportingIndexes()); | ||
afterEach(() => reportingAPI.deleteAllReportingIndexes()); | ||
|
||
describe('initial usage', () => { | ||
describe('initial state', () => { | ||
let usage; | ||
|
||
before(async () => { | ||
|
@@ -45,7 +44,7 @@ export default function ({ getService }) { | |
}); | ||
}); | ||
|
||
describe('includes usage from reporting indexes', () => { | ||
describe('from archive data', () => { | ||
it('generated from 6.2', async () => { | ||
await esArchiver.load('bwc/6_2'); | ||
const usage = await usageAPI.getUsageStats(); | ||
|
@@ -79,44 +78,65 @@ export default function ({ getService }) { | |
reportingAPI.expectRecentPdfLayoutStats(usage, 'preserve_layout', 0); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'print', 0); | ||
|
||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'csv', 3); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 19); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'csv', 2); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 12); | ||
reportingAPI.expectAllTimePdfAppStats(usage, 'visualization', 3); | ||
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 3); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 3); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 3); | ||
}); | ||
}); | ||
|
||
describe.skip('usage updated when new jobs are posted', async () => { | ||
it('post jobs', async () => { | ||
const reportPaths = []; | ||
reportPaths.push(await reportingAPI.postJob(GenerationUrls.CSV_DISCOVER_KUERY_AND_FILTER_6_3)); | ||
reportPaths.push(await reportingAPI.postJob(GenerationUrls.PDF_PRESERVE_DASHBOARD_FILTER_6_3)); | ||
reportPaths.push(await reportingAPI.postJob(GenerationUrls.PDF_PRESERVE_PIE_VISUALIZATION_6_3)); | ||
reportPaths.push(await reportingAPI.postJob(GenerationUrls.PDF_PRINT_DASHBOARD_6_3)); | ||
reportPaths.push(await reportingAPI.postJob( | ||
GenerationUrls.PDF_PRINT_PIE_VISUALIZATION_FILTER_AND_SAVED_SEARCH_6_3)); | ||
|
||
await reportingAPI.expectAllJobsToFinishSuccessfully(reportPaths); | ||
}).timeout(1540000); | ||
describe('from new jobs posted', () => { | ||
it('csv', async () => { | ||
await reportingAPI.expectAllJobsToFinishSuccessfully(await Promise.all([ | ||
reportingAPI.postJob(GenerationUrls.CSV_DISCOVER_KUERY_AND_FILTER_6_3), | ||
])); | ||
|
||
it('usage updated', async () => { | ||
const usage = await usageAPI.getUsageStats(); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'visualization', 0); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'dashboard', 0); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'preserve_layout', 0); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'print', 0); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 1); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 0); | ||
}); | ||
|
||
reportingAPI.expectRecentPdfAppStats(usage, 'visualization', 2); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'dashboard', 2); | ||
it('preserve_layout pdf', async () => { | ||
await reportingAPI.expectAllJobsToFinishSuccessfully(await Promise.all([ | ||
reportingAPI.postJob(GenerationUrls.PDF_PRESERVE_DASHBOARD_FILTER_6_3), | ||
reportingAPI.postJob(GenerationUrls.PDF_PRESERVE_PIE_VISUALIZATION_6_3), | ||
])); | ||
|
||
const usage = await usageAPI.getUsageStats(); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'visualization', 1); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'dashboard', 1); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'preserve_layout', 2); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'print', 0); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 0); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 2); | ||
}); | ||
|
||
it('print_layout pdf', async () => { | ||
await reportingAPI.expectAllJobsToFinishSuccessfully(await Promise.all([ | ||
reportingAPI.postJob(GenerationUrls.PDF_PRINT_DASHBOARD_6_3), | ||
reportingAPI.postJob(GenerationUrls.PDF_PRINT_PIE_VISUALIZATION_FILTER_AND_SAVED_SEARCH_6_3), | ||
])); | ||
|
||
const usage = await usageAPI.getUsageStats(); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'visualization', 1); | ||
reportingAPI.expectRecentPdfAppStats(usage, 'dashboard', 1); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'preserve_layout', 0); | ||
reportingAPI.expectRecentPdfLayoutStats(usage, 'print', 2); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 1); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 4); | ||
|
||
reportingAPI.expectAllTimePdfAppStats(usage, 'visualization', 5); | ||
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 5); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 5); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 5); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'csv', 4); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 23); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 0); | ||
reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 2); | ||
|
||
reportingAPI.expectAllTimePdfAppStats(usage, 'visualization', 1); | ||
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 1); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 0); | ||
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 2); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'csv', 0); | ||
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 2); | ||
}); | ||
}); | ||
}); | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally, we would want to log a warning here, but there is no logger in context in this function.
We could also check the
statusCode
on the err object to try to be certain it's a case of attempt to create an index that already exists. It isn't super specific though, the statusCode will just be 400.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The FIXME was that we should log a warning here. That'll take a bit of refactoring to get a logger in scope