Skip to content

Commit

Permalink
[ML] extra test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jan 15, 2020
1 parent 87edf1b commit 01da7df
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,44 @@ const COMMON_HEADERS = {
};

const testDataList = [
{
testTitleSuffix: 'with 0 metrics, 0 influencers and no split field',
requestBody: {
indexPattern: 'ecommerce',
splitFieldName: '',
query: { bool: { must: [{ match_all: {} }], filter: [], must_not: [] } },
fieldNames: ['__ml_event_rate_count__'],
influencerNames: [],
timeFieldName: 'order_date',
earliestMs: 1560297859000,
latestMs: 1562975136000,
},
expected: {
responseCode: 400,
responseBody: {
statusCode: 400,
error: 'Bad Request',
message: "[illegal_argument_exception] specified fields can't be null or empty",
},
},
},
{
testTitleSuffix: 'with 1 metrics and 1 influencers same as split field',
requestBody: {
indexPattern: 'ecommerce',
splitFieldName: 'geoip.city_name',
query: { bool: { must: [{ match_all: {} }], filter: [], must_not: [] } },
fieldNames: ['products.base_price'],
influencerNames: ['geoip.city_name'],
timeFieldName: 'order_date',
earliestMs: 1560297859000,
latestMs: 1562975136000,
},
expected: {
responseCode: 200,
responseBody: { modelMemoryLimit: '12MB' },
},
},
{
testTitleSuffix: 'with 3 metrics, 3 influencers, split by city',
requestBody: {
Expand Down

0 comments on commit 01da7df

Please sign in to comment.