update estimateBucketSpan schema and api test (#58004)

This commit is contained in:
Melissa Alvarez 2020-02-20 09:13:49 -05:00 committed by GitHub
parent 39c835af60
commit 47bb7c61b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -11,6 +11,7 @@ export const estimateBucketSpanSchema = schema.object({
aggTypes: schema.arrayOf(schema.nullable(schema.string())),
duration: schema.object({ start: schema.number(), end: schema.number() }),
fields: schema.arrayOf(schema.nullable(schema.string())),
filters: schema.maybe(schema.arrayOf(schema.any())),
index: schema.string(),
query: schema.any(),
splitField: schema.maybe(schema.string()),

View file

@ -69,6 +69,23 @@ export default ({ getService }: FtrProviderContext) => {
responseBody: { name: '3h', ms: 10800000 },
},
},
{
testTitleSuffix: 'with 1 field, 1 agg, no split, and empty filters',
user: USER.ML_POWERUSER,
requestBody: {
aggTypes: ['avg'],
duration: { start: 1560297859000, end: 1562975136000 },
fields: ['taxless_total_price'],
filters: [],
index: 'ecommerce',
query: { bool: { must: [{ match_all: {} }] } },
timeField: 'order_date',
},
expected: {
responseCode: 200,
responseBody: { name: '15m', ms: 900000 },
},
},
];
describe('bucket span estimator', function() {