mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Update esarchive ecommerce dataset, enable alerting flyout tests (#186630)
## Summary Closes #186261 and #102012 - Updates timestamps in the esarchive ecommerce data set (from 2019 to 2023) - Enables anomaly detection alert flyout tests ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
bb669bbd91
commit
745abf7624
14 changed files with 70 additions and 71 deletions
|
@ -32,11 +32,11 @@ export const getLogRateAnalysisTestData = <T extends ApiVersion>(): Array<TestDa
|
|||
testName: 'ecommerce',
|
||||
esArchive: 'x-pack/test/functional/es_archives/ml/ecommerce',
|
||||
requestBody: {
|
||||
baselineMax: 1561719083292,
|
||||
baselineMin: 1560954147006,
|
||||
deviationMax: 1562254538692,
|
||||
deviationMin: 1561986810992,
|
||||
end: 2147483647000,
|
||||
baselineMax: 1687949483292,
|
||||
baselineMin: 1687184547006,
|
||||
deviationMax: 1688484938692,
|
||||
deviationMin: 1688217210992,
|
||||
end: 2273714047000,
|
||||
index: 'ft_ecommerce',
|
||||
searchQuery: '{"match_all":{}}',
|
||||
start: 0,
|
||||
|
|
|
@ -42,8 +42,8 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
fieldNames: ['geoip.city_name', 'geoip.continent_name', 'geoip.country_iso_code'],
|
||||
query: { bool: { must: [{ match_all: {} }] } },
|
||||
timeFieldName: 'order_date',
|
||||
earliestMs: 1560556800000, // June 15, 2019 12:00:00 AM GMT
|
||||
latestMs: 1560643199000, // June 15, 2019 11:59:59 PM GMT
|
||||
earliestMs: 1686787200000, // June 15, 2023 12:00:00 AM GMT
|
||||
latestMs: 1686873599000, // June 15, 2023 11:59:59 PM GMT
|
||||
},
|
||||
expected: {
|
||||
statusCode: 200,
|
||||
|
@ -62,8 +62,8 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
fieldNames: ['manufacturer'],
|
||||
query: { bool: { must: [{ match_all: {} }] } },
|
||||
timeFieldName: 'order_date',
|
||||
earliestMs: 1560556800000, // June 15, 2019 12:00:00 AM GMT
|
||||
latestMs: 1560643199000, // June 15, 2019 11:59:59 PM GMT
|
||||
earliestMs: 1686787200000, // June 15, 2023 12:00:00 AM GMT
|
||||
latestMs: 1686873599000, // June 15, 2023 11:59:59 PM GMT
|
||||
},
|
||||
expected: {
|
||||
statusCode: 200,
|
||||
|
|
|
@ -28,8 +28,8 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
expected: {
|
||||
responseCode: 200,
|
||||
responseBody: {
|
||||
start: 1560297859000,
|
||||
end: 1562975136000,
|
||||
start: 1686528259000,
|
||||
end: 1689205536000,
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
|
@ -51,8 +51,8 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
expected: {
|
||||
responseCode: 200,
|
||||
responseBody: {
|
||||
start: 1560298982000,
|
||||
end: 1562973754000,
|
||||
start: 1686529382000,
|
||||
end: 1689204154000,
|
||||
success: true,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
user: USER.ML_POWERUSER,
|
||||
requestBody: {
|
||||
aggTypes: ['avg'],
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
fields: ['taxless_total_price'],
|
||||
index: 'ft_ecommerce',
|
||||
query: { bool: { must: [{ match_all: {} }] } },
|
||||
|
@ -39,7 +39,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
user: USER.ML_POWERUSER,
|
||||
requestBody: {
|
||||
aggTypes: ['avg', 'sum'],
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
fields: ['products.base_price', 'products.base_unit_price'],
|
||||
index: 'ft_ecommerce',
|
||||
query: { bool: { must: [{ match_all: {} }] } },
|
||||
|
@ -55,7 +55,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
user: USER.ML_POWERUSER,
|
||||
requestBody: {
|
||||
aggTypes: ['avg'],
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
fields: ['taxless_total_price'],
|
||||
index: 'ft_ecommerce',
|
||||
query: { bool: { must: [{ match_all: {} }] } },
|
||||
|
@ -72,7 +72,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
user: USER.ML_POWERUSER,
|
||||
requestBody: {
|
||||
aggTypes: ['avg'],
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
fields: ['taxless_total_price'],
|
||||
filters: [],
|
||||
index: 'ft_ecommerce',
|
||||
|
|
|
@ -32,7 +32,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
|
||||
it(`should recognize a valid job configuration`, async () => {
|
||||
const requestBody = {
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
job: {
|
||||
job_id: 'test',
|
||||
description: '',
|
||||
|
@ -82,7 +82,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
|
||||
it('should recognize a basic invalid job configuration and skip advanced checks', async () => {
|
||||
const requestBody = {
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
job: {
|
||||
job_id: '-(*&^',
|
||||
description: '',
|
||||
|
@ -126,7 +126,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
|
||||
it('should recognize non-basic issues in job configuration', async () => {
|
||||
const requestBody = {
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
job: {
|
||||
job_id: 'test',
|
||||
description: '',
|
||||
|
@ -204,7 +204,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
|
||||
it('should not validate configuration in case request payload is invalid', async () => {
|
||||
const requestBody = {
|
||||
duration: { start: 1560297859000, end: 1562975136000 },
|
||||
duration: { start: 1686528259000, end: 1689205536000 },
|
||||
job: {
|
||||
job_id: 'test',
|
||||
description: '',
|
||||
|
|
|
@ -94,7 +94,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
memoryStatus: 'ok',
|
||||
jobState: 'closed',
|
||||
datafeedState: 'stopped',
|
||||
latestTimestamp: '2019-07-12 23:45:36',
|
||||
latestTimestamp: '2023-07-12 23:45:36',
|
||||
},
|
||||
counts: {
|
||||
processed_record_count: '4,675',
|
||||
|
@ -107,10 +107,10 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
empty_bucket_count: '0',
|
||||
sparse_bucket_count: '0',
|
||||
bucket_count: '743',
|
||||
earliest_record_timestamp: '2019-06-12 00:04:19',
|
||||
latest_record_timestamp: '2019-07-12 23:45:36',
|
||||
earliest_record_timestamp: '2023-06-12 00:04:19',
|
||||
latest_record_timestamp: '2023-07-12 23:45:36',
|
||||
input_record_count: '4,675',
|
||||
latest_bucket_timestamp: '2019-07-12 23:00:00',
|
||||
latest_bucket_timestamp: '2023-07-12 23:00:00',
|
||||
},
|
||||
modelSizeStats: {
|
||||
result_type: 'model_size_stats',
|
||||
|
@ -120,7 +120,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
total_partition_field_count: '8',
|
||||
bucket_allocation_failures_count: '0',
|
||||
memory_status: 'ok',
|
||||
timestamp: '2019-07-12 22:00:00',
|
||||
timestamp: '2023-07-12 22:00:00',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -284,8 +284,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job creation sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -501,8 +501,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job creation sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep('population job creation displays the event rate chart');
|
||||
|
|
|
@ -40,7 +40,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
memoryStatus: 'ok',
|
||||
jobState: 'closed',
|
||||
datafeedState: 'stopped',
|
||||
latestTimestamp: '2019-07-12 23:45:36',
|
||||
latestTimestamp: '2023-07-12 23:45:36',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,10 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
empty_bucket_count: '492',
|
||||
sparse_bucket_count: '0',
|
||||
bucket_count: '2,975',
|
||||
earliest_record_timestamp: '2019-06-12 00:04:19',
|
||||
latest_record_timestamp: '2019-07-12 23:45:36',
|
||||
earliest_record_timestamp: '2023-06-12 00:04:19',
|
||||
latest_record_timestamp: '2023-07-12 23:45:36',
|
||||
input_record_count: '4,675',
|
||||
latest_bucket_timestamp: '2019-07-12 23:45:00',
|
||||
latest_bucket_timestamp: '2023-07-12 23:45:00',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
total_partition_field_count: '3',
|
||||
bucket_allocation_failures_count: '0',
|
||||
memory_status: 'ok',
|
||||
timestamp: '2019-07-12 23:30:00',
|
||||
timestamp: '2023-07-12 23:30:00',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -117,8 +117,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job creation sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep('job creation displays the event rate chart');
|
||||
|
@ -245,8 +245,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job cloning sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep('job cloning displays the event rate chart');
|
||||
|
|
|
@ -54,7 +54,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
memoryStatus: 'ok',
|
||||
jobState: 'closed',
|
||||
datafeedState: 'stopped',
|
||||
latestTimestamp: '2019-07-12 23:45:36',
|
||||
latestTimestamp: '2023-07-12 23:45:36',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -71,10 +71,10 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
empty_bucket_count: '0',
|
||||
sparse_bucket_count: '0',
|
||||
bucket_count: '371',
|
||||
earliest_record_timestamp: '2019-06-12 00:04:19',
|
||||
latest_record_timestamp: '2019-07-12 23:45:36',
|
||||
earliest_record_timestamp: '2023-06-12 00:04:19',
|
||||
latest_record_timestamp: '2023-07-12 23:45:36',
|
||||
input_record_count: '4,675',
|
||||
latest_bucket_timestamp: '2019-07-12 22:00:00',
|
||||
latest_bucket_timestamp: '2023-07-12 22:00:00',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
total_partition_field_count: '3',
|
||||
bucket_allocation_failures_count: '0',
|
||||
memory_status: 'ok',
|
||||
timestamp: '2019-07-12 20:00:00',
|
||||
timestamp: '2023-07-12 20:00:00',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -132,8 +132,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job creation sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep('job creation displays the event rate chart');
|
||||
|
@ -285,8 +285,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job cloning sets the time range');
|
||||
await ml.jobWizardCommon.clickUseFullDataButton(
|
||||
'Jun 12, 2019 @ 00:04:19.000',
|
||||
'Jul 12, 2019 @ 23:45:36.000'
|
||||
'Jun 12, 2023 @ 00:04:19.000',
|
||||
'Jul 12, 2023 @ 23:45:36.000'
|
||||
);
|
||||
|
||||
await ml.testExecution.logTestStep('job cloning displays the event rate chart');
|
||||
|
|
|
@ -211,11 +211,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
transformPreview: {
|
||||
column: 0,
|
||||
values: [
|
||||
'July 12th 2019, 22:16:19',
|
||||
'July 12th 2019, 22:50:53',
|
||||
'July 12th 2019, 23:06:43',
|
||||
'July 12th 2019, 23:15:22',
|
||||
'July 12th 2019, 23:31:12',
|
||||
'July 12th 2023, 22:16:19',
|
||||
'July 12th 2023, 22:50:53',
|
||||
'July 12th 2023, 23:06:43',
|
||||
'July 12th 2023, 23:15:22',
|
||||
'July 12th 2023, 23:31:12',
|
||||
],
|
||||
},
|
||||
discoverQueryHits: '10',
|
||||
|
|
|
@ -124,8 +124,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
numFailureRetries: '7',
|
||||
expected: {
|
||||
fullTimeRange: {
|
||||
start: 'Jun 12, 2019 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2019 @ 23:45:36.000',
|
||||
start: 'Jun 12, 2023 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2023 @ 23:45:36.000',
|
||||
},
|
||||
pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "category": {'],
|
||||
pivotAdvancedEditorValue: {
|
||||
|
@ -327,8 +327,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
numFailureRetries: '-1',
|
||||
expected: {
|
||||
fullTimeRange: {
|
||||
start: 'Jun 12, 2019 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2019 @ 23:45:36.000',
|
||||
start: 'Jun 12, 2023 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2023 @ 23:45:36.000',
|
||||
},
|
||||
pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "geoip.country_iso_code": {'],
|
||||
pivotAdvancedEditorValue: {
|
||||
|
@ -406,8 +406,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
numFailureRetries: '0',
|
||||
expected: {
|
||||
fullTimeRange: {
|
||||
start: 'Jun 12, 2019 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2019 @ 23:45:36.000',
|
||||
start: 'Jun 12, 2023 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2023 @ 23:45:36.000',
|
||||
},
|
||||
pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "customer_gender": {'],
|
||||
pivotAdvancedEditorValue: {
|
||||
|
@ -472,8 +472,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
numFailureRetries: '101',
|
||||
expected: {
|
||||
fullTimeRange: {
|
||||
start: 'Jun 12, 2019 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2019 @ 23:45:36.000',
|
||||
start: 'Jun 12, 2023 @ 00:04:19.000',
|
||||
end: 'Jul 12, 2023 @ 23:45:36.000',
|
||||
},
|
||||
latestPreview: {
|
||||
column: 0,
|
||||
|
@ -492,11 +492,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
transformPreview: {
|
||||
column: 0,
|
||||
values: [
|
||||
'July 12th 2019, 22:16:19',
|
||||
'July 12th 2019, 22:50:53',
|
||||
'July 12th 2019, 23:06:43',
|
||||
'July 12th 2019, 23:15:22',
|
||||
'July 12th 2019, 23:31:12',
|
||||
'July 12th 2023, 22:16:19',
|
||||
'July 12th 2023, 22:50:53',
|
||||
'July 12th 2023, 23:06:43',
|
||||
'July 12th 2023, 23:15:22',
|
||||
'July 12th 2023, 23:31:12',
|
||||
],
|
||||
},
|
||||
discoverQueryHits: '10',
|
||||
|
|
|
@ -383,9 +383,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
transformPreview: {
|
||||
column: 0,
|
||||
values: [
|
||||
'July 12th 2019, 23:06:43',
|
||||
'July 12th 2019, 23:31:12',
|
||||
'July 12th 2019, 23:45:36',
|
||||
'July 12th 2023, 23:06:43',
|
||||
'July 12th 2023, 23:31:12',
|
||||
'July 12th 2023, 23:45:36',
|
||||
],
|
||||
},
|
||||
retentionPolicySwitchEnabled: false,
|
||||
|
|
Binary file not shown.
|
@ -67,8 +67,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
|
||||
let testJobId = '';
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/186261
|
||||
describe.skip('anomaly detection alert', function () {
|
||||
describe('anomaly detection alert', function () {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
|
||||
await ml.testResources.createDataViewIfNeeded('ft_ecommerce', 'order_date');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue