Skip to content
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

[7.x] Use static time for tsvb rollup test (#57701) #58099

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions x-pack/test/functional/apps/rollup_job/tsvb.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/

import datemath from '@elastic/datemath';
import expect from '@kbn/expect';
import mockRolledUpData from './hybrid_index_helper';

export default function({ getService, getPageObjects }) {
const es = getService('legacyEs');
const esArchiver = getService('esArchiver');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects([
'common',
'settings',
Expand All @@ -21,18 +19,16 @@ export default function({ getService, getPageObjects }) {
'timePicker',
]);

// FLAKY: https://github.com/elastic/kibana/issues/56816
describe.skip('tsvb integration', function() {
describe('tsvb integration', function() {
//Since rollups can only be created once with the same name (even if you delete it),
//we add the Date.now() to avoid name collision if you run the tests locally back to back.
const rollupJobName = `tsvb-test-rollup-job-${Date.now()}`;
const rollupSourceIndexName = 'rollup-source-data';
const rollupTargetIndexName = `rollup-target-data`;
const now = new Date();
const pastDates = [
datemath.parse('now-1m', { forceNow: now }),
datemath.parse('now-2m', { forceNow: now }),
datemath.parse('now-3m', { forceNow: now }),
new Date('October 15, 2019 05:35:32'),
new Date('October 15, 2019 05:34:32'),
new Date('October 15, 2019 05:33:32'),
];

before(async () => {
Expand Down Expand Up @@ -78,10 +74,12 @@ export default function({ getService, getPageObjects }) {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisualBuilder();
await PageObjects.visualBuilder.checkVisualBuilderIsPresent();
await PageObjects.timePicker.openQuickSelectTimeMenu();
await testSubjects.click('superDatePickerCommonlyUsed_Last_24 hours');
await PageObjects.visualBuilder.clickMetric();
await PageObjects.visualBuilder.checkMetricTabIsPresent();
await PageObjects.timePicker.setAbsoluteRange(
'Oct 15, 2019 @ 00:00:01.000',
'Oct 15, 2019 @ 19:31:44.000'
);
await PageObjects.visualBuilder.clickPanelOptions('metric');
await PageObjects.visualBuilder.setIndexPatternValue(rollupTargetIndexName);
await PageObjects.visualBuilder.setIntervalValue('1d');
Expand Down