From bbd5edb50f33cf96912402933ba4a21c4c3f9b1d Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 9 May 2019 10:18:18 -0700 Subject: [PATCH] Reenable Rollup Jobs API test that was failing due to interval change in ES. (#36310) --- x-pack/plugins/rollup/public/crud_app/services/jobs.js | 8 +++++++- .../test/api_integration/apis/management/rollup/rollup.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/rollup/public/crud_app/services/jobs.js b/x-pack/plugins/rollup/public/crud_app/services/jobs.js index 67eae5242e2cf..02ea70de7023d 100644 --- a/x-pack/plugins/rollup/public/crud_app/services/jobs.js +++ b/x-pack/plugins/rollup/public/crud_app/services/jobs.js @@ -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, @@ -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, diff --git a/x-pack/test/api_integration/apis/management/rollup/rollup.js b/x-pack/test/api_integration/apis/management/rollup/rollup.js index f189cb08513ff..111cefcaa9696 100644 --- a/x-pack/test/api_integration/apis/management/rollup/rollup.js +++ b/x-pack/test/api_integration/apis/management/rollup/rollup.js @@ -139,7 +139,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 + // `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' } },