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

Reenable Rollup Jobs API test that was failing due to interval change in ES #36310

Merged
merged 5 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion x-pack/plugins/rollup/public/crud_app/services/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export function deserializeJob(job) {
metrics,
groups: {
date_histogram: {
interval: dateHistogramInterval,
interval,
fixed_interval: fixedInterval,
calendar_interval: calendarInterval,
delay: rollupDelay,
time_zone: dateHistogramTimeZone,
field: dateHistogramField,
Expand All @@ -108,6 +110,10 @@ export function deserializeJob(job) {

const json = job;

// `interval` is deprecated but still supported. All three of the various interval types are
// mutually exclusive.
const dateHistogramInterval = interval || fixedInterval || calendarInterval;

const deserializedJob = {
id,
indexPattern,
Expand Down
9 changes: 6 additions & 3 deletions x-pack/test/api_integration/apis/management/rollup/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ export default function ({ getService }) {
expect(job.config.rollup_index).to.eql(payload.job.rollup_index);
});

// broken after snapshot update: https://github.com/elastic/kibana/issues/36269
it.skip('should create the underlying rollup index with the correct aggregations', async () => {
it('should create the underlying rollup index with the correct aggregations', async () => {
await createJob(getJobPayload(indexName));

const { body } = await supertest.get(`${API_BASE_PATH}/indices`);
Expand All @@ -139,7 +138,11 @@ export default function ({ getService }) {
'testCreatedField': {
'agg': 'date_histogram',
'delay': '1d',
'interval': '24h',
// TODO: Note that we created the job with `interval`, but ES has coerced this to
Copy link
Contributor

@sebelga sebelga May 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we address it in this PR?

[edit]: sorry, just tested trying to provide "fixed_interval" in the payload and apparently it is not yet supported. So if I understand well, the create job API needs interval to be provided but the get job API returns fixed_interval?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interval is deprecated, but still supported. When ES receives interval it will coerce it into either fixed_interval or calendar_interval, which is why we see one of those when getting the rollup capabilities/job from ES. Jen opened #36306 to update the UI at some point to support creation of a rollup job with either fixed_interval or calendar_interval, instead of interval, but it's not a necessary change at the moment.

// `fixed_interval` based on the value we provided. Once we update the UI and
// tests to no longer use the deprecated `interval` property, we can remove
// this comment.
'fixed_interval': '24h',
'time_zone': 'UTC'
}
},
Expand Down