[7.17] [ML] Update esarchive ecommerce dataset, enable alerting flyout tests (#186630) (#186943)

# Backport

Closes https://github.com/elastic/kibana/issues/102012

This will backport the following commits from `main` to `7.17`:
- [[ML] Update esarchive ecommerce dataset, enable alerting flyout tests
(#186630)](https://github.com/elastic/kibana/pull/186630)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2024-06-24T13:55:29Z","message":"[ML]
Update esarchive ecommerce dataset, enable alerting flyout tests
(#186630)\n\n## Summary\r\n\r\nCloses #186261 and #102012\r\n\r\n-
Updates timestamps in the esarchive ecommerce data set (from 2019
to\r\n2023)\r\n- Enables anomaly detection alert flyout tests
\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"745abf7624c98105ef273d8d1d57730a33728c32","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","test_ui_functional","release_note:skip","backport:skip","Team:ML","v8.15.0"],"number":186630,"url":"https://github.com/elastic/kibana/pull/186630","mergeCommit":{"message":"[ML]
Update esarchive ecommerce dataset, enable alerting flyout tests
(#186630)\n\n## Summary\r\n\r\nCloses #186261 and #102012\r\n\r\n-
Updates timestamps in the esarchive ecommerce data set (from 2019
to\r\n2023)\r\n- Enables anomaly detection alert flyout tests
\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"745abf7624c98105ef273d8d1d57730a33728c32"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186630","number":186630,"mergeCommit":{"message":"[ML]
Update esarchive ecommerce dataset, enable alerting flyout tests
(#186630)\n\n## Summary\r\n\r\nCloses #186261 and #102012\r\n\r\n-
Updates timestamps in the esarchive ecommerce data set (from 2019
to\r\n2023)\r\n- Enables anomaly detection alert flyout tests
\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"745abf7624c98105ef273d8d1d57730a33728c32"}}]}]
BACKPORT-->
This commit is contained in:
Dima Arnautov 2024-07-03 18:09:11 +03:00 committed by GitHub
parent 8b026e3dc1
commit 626d2960fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 57 additions and 50 deletions

View file

@ -42,8 +42,8 @@ export default ({ getService }: FtrProviderContext) => {
fieldNames: ['geoip.city_name', 'geoip.continent_name', 'geoip.country_iso_code'], fieldNames: ['geoip.city_name', 'geoip.continent_name', 'geoip.country_iso_code'],
query: { bool: { must: [{ match_all: {} }] } }, query: { bool: { must: [{ match_all: {} }] } },
timeFieldName: 'order_date', timeFieldName: 'order_date',
earliestMs: 1560556800000, // June 15, 2019 12:00:00 AM GMT earliestMs: 1686787200000, // June 15, 2023 12:00:00 AM GMT
latestMs: 1560643199000, // June 15, 2019 11:59:59 PM GMT latestMs: 1686873599000, // June 15, 2023 11:59:59 PM GMT
}, },
expected: { expected: {
statusCode: 200, statusCode: 200,
@ -62,8 +62,8 @@ export default ({ getService }: FtrProviderContext) => {
fieldNames: ['manufacturer'], fieldNames: ['manufacturer'],
query: { bool: { must: [{ match_all: {} }] } }, query: { bool: { must: [{ match_all: {} }] } },
timeFieldName: 'order_date', timeFieldName: 'order_date',
earliestMs: 1560556800000, // June 15, 2019 12:00:00 AM GMT earliestMs: 1686787200000, // June 15, 2023 12:00:00 AM GMT
latestMs: 1560643199000, // June 15, 2019 11:59:59 PM GMT latestMs: 1686873599000, // June 15, 2023 11:59:59 PM GMT
}, },
expected: { expected: {
statusCode: 200, statusCode: 200,

View file

@ -29,12 +29,12 @@ export default ({ getService }: FtrProviderContext) => {
responseCode: 200, responseCode: 200,
responseBody: { responseBody: {
start: { start: {
epoch: 1560297859000, epoch: 1686528259000,
string: '2019-06-12T00:04:19.000Z', string: '2023-06-12T00:04:19.000Z',
}, },
end: { end: {
epoch: 1562975136000, epoch: 1689205536000,
string: '2019-07-12T23:45:36.000Z', string: '2023-07-12T23:45:36.000Z',
}, },
success: true, success: true,
}, },
@ -58,12 +58,12 @@ export default ({ getService }: FtrProviderContext) => {
responseCode: 200, responseCode: 200,
responseBody: { responseBody: {
start: { start: {
epoch: 1560298982000, epoch: 1686529382000,
string: '2019-06-12T00:23:02.000Z', string: '2023-06-12T00:23:02.000Z',
}, },
end: { end: {
epoch: 1562973754000, epoch: 1689204154000,
string: '2019-07-12T23:22:34.000Z', string: '2023-07-12T23:22:34.000Z',
}, },
success: true, success: true,
}, },

View file

@ -23,7 +23,7 @@ export default ({ getService }: FtrProviderContext) => {
user: USER.ML_POWERUSER, user: USER.ML_POWERUSER,
requestBody: { requestBody: {
aggTypes: ['avg'], aggTypes: ['avg'],
duration: { start: 1560297859000, end: 1562975136000 }, duration: { start: 1686528259000, end: 1689205536000 },
fields: ['taxless_total_price'], fields: ['taxless_total_price'],
index: 'ft_ecommerce', index: 'ft_ecommerce',
query: { bool: { must: [{ match_all: {} }] } }, query: { bool: { must: [{ match_all: {} }] } },
@ -39,7 +39,7 @@ export default ({ getService }: FtrProviderContext) => {
user: USER.ML_POWERUSER, user: USER.ML_POWERUSER,
requestBody: { requestBody: {
aggTypes: ['avg', 'sum'], aggTypes: ['avg', 'sum'],
duration: { start: 1560297859000, end: 1562975136000 }, duration: { start: 1686528259000, end: 1689205536000 },
fields: ['products.base_price', 'products.base_unit_price'], fields: ['products.base_price', 'products.base_unit_price'],
index: 'ft_ecommerce', index: 'ft_ecommerce',
query: { bool: { must: [{ match_all: {} }] } }, query: { bool: { must: [{ match_all: {} }] } },
@ -55,7 +55,7 @@ export default ({ getService }: FtrProviderContext) => {
user: USER.ML_POWERUSER, user: USER.ML_POWERUSER,
requestBody: { requestBody: {
aggTypes: ['avg'], aggTypes: ['avg'],
duration: { start: 1560297859000, end: 1562975136000 }, duration: { start: 1686528259000, end: 1689205536000 },
fields: ['taxless_total_price'], fields: ['taxless_total_price'],
index: 'ft_ecommerce', index: 'ft_ecommerce',
query: { bool: { must: [{ match_all: {} }] } }, query: { bool: { must: [{ match_all: {} }] } },
@ -72,7 +72,7 @@ export default ({ getService }: FtrProviderContext) => {
user: USER.ML_POWERUSER, user: USER.ML_POWERUSER,
requestBody: { requestBody: {
aggTypes: ['avg'], aggTypes: ['avg'],
duration: { start: 1560297859000, end: 1562975136000 }, duration: { start: 1686528259000, end: 1689205536000 },
fields: ['taxless_total_price'], fields: ['taxless_total_price'],
filters: [], filters: [],
index: 'ft_ecommerce', index: 'ft_ecommerce',

View file

@ -32,7 +32,7 @@ export default ({ getService }: FtrProviderContext) => {
it(`should recognize a valid job configuration`, async () => { it(`should recognize a valid job configuration`, async () => {
const requestBody = { const requestBody = {
duration: { start: 1586995459000, end: 1589672736000 }, duration: { start: 1686528259000, end: 1689205536000 },
job: { job: {
job_id: 'test', job_id: 'test',
description: '', description: '',
@ -82,7 +82,7 @@ export default ({ getService }: FtrProviderContext) => {
it('should recognize a basic invalid job configuration and skip advanced checks', async () => { it('should recognize a basic invalid job configuration and skip advanced checks', async () => {
const requestBody = { const requestBody = {
duration: { start: 1586995459000, end: 1589672736000 }, duration: { start: 1686528259000, end: 1689205536000 },
job: { job: {
job_id: '-(*&^', job_id: '-(*&^',
description: '', description: '',
@ -126,7 +126,7 @@ export default ({ getService }: FtrProviderContext) => {
it('should recognize non-basic issues in job configuration', async () => { it('should recognize non-basic issues in job configuration', async () => {
const requestBody = { const requestBody = {
duration: { start: 1586995459000, end: 1589672736000 }, duration: { start: 1686528259000, end: 1689205536000 },
job: { job: {
job_id: 'test', job_id: 'test',
description: '', description: '',
@ -204,7 +204,7 @@ export default ({ getService }: FtrProviderContext) => {
it('should not validate configuration in case request payload is invalid', async () => { it('should not validate configuration in case request payload is invalid', async () => {
const requestBody = { const requestBody = {
duration: { start: 1586995459000, end: 1589672736000 }, duration: { start: 1686528259000, end: 1689205536000 },
job: { job: {
job_id: 'test', job_id: 'test',
description: '', description: '',

View file

@ -119,7 +119,7 @@ export default function ({ getService }: FtrProviderContext) {
memoryStatus: 'ok', memoryStatus: 'ok',
jobState: 'closed', jobState: 'closed',
datafeedState: 'stopped', datafeedState: 'stopped',
latestTimestamp: '2019-07-12 23:45:36', latestTimestamp: '2023-07-12 23:45:36',
}, },
counts: { counts: {
processed_record_count: '4,675', processed_record_count: '4,675',
@ -132,10 +132,10 @@ export default function ({ getService }: FtrProviderContext) {
empty_bucket_count: '0', empty_bucket_count: '0',
sparse_bucket_count: '0', sparse_bucket_count: '0',
bucket_count: '743', bucket_count: '743',
earliest_record_timestamp: '2019-06-12 00:04:19', earliest_record_timestamp: '2023-06-12 00:04:19',
latest_record_timestamp: '2019-07-12 23:45:36', latest_record_timestamp: '2023-07-12 23:45:36',
input_record_count: '4,675', input_record_count: '4,675',
latest_bucket_timestamp: '2019-07-12 23:00:00', latest_bucket_timestamp: '2023-07-12 23:00:00',
}, },
modelSizeStats: { modelSizeStats: {
result_type: 'model_size_stats', result_type: 'model_size_stats',
@ -145,7 +145,7 @@ export default function ({ getService }: FtrProviderContext) {
total_partition_field_count: '8', total_partition_field_count: '8',
bucket_allocation_failures_count: '0', bucket_allocation_failures_count: '0',
memory_status: 'ok', memory_status: 'ok',
timestamp: '2019-07-12 22:00:00', timestamp: '2023-07-12 22:00:00',
}, },
}, },
}, },

View file

@ -45,7 +45,7 @@ export default function ({ getService }: FtrProviderContext) {
memoryStatus: 'ok', memoryStatus: 'ok',
jobState: 'closed', jobState: 'closed',
datafeedState: 'stopped', datafeedState: 'stopped',
latestTimestamp: '2019-07-12 23:45:36', latestTimestamp: '2023-07-12 23:45:36',
}; };
} }
@ -62,10 +62,10 @@ export default function ({ getService }: FtrProviderContext) {
empty_bucket_count: '0', empty_bucket_count: '0',
sparse_bucket_count: '0', sparse_bucket_count: '0',
bucket_count: '371', bucket_count: '371',
earliest_record_timestamp: '2019-06-12 00:04:19', earliest_record_timestamp: '2023-06-12 00:04:19',
latest_record_timestamp: '2019-07-12 23:45:36', latest_record_timestamp: '2023-07-12 23:45:36',
input_record_count: '4,675', input_record_count: '4,675',
latest_bucket_timestamp: '2019-07-12 22:00:00', latest_bucket_timestamp: '2023-07-12 22:00:00',
}; };
} }
@ -79,7 +79,7 @@ export default function ({ getService }: FtrProviderContext) {
total_partition_field_count: '3', total_partition_field_count: '3',
bucket_allocation_failures_count: '0', bucket_allocation_failures_count: '0',
memory_status: 'ok', memory_status: 'ok',
timestamp: '2019-07-12 20:00:00', timestamp: '2023-07-12 20:00:00',
}; };
} }
@ -122,8 +122,8 @@ export default function ({ getService }: FtrProviderContext) {
await ml.testExecution.logTestStep('job creation sets the time range'); await ml.testExecution.logTestStep('job creation sets the time range');
await ml.jobWizardCommon.clickUseFullDataButton( await ml.jobWizardCommon.clickUseFullDataButton(
'Jun 12, 2019 @ 00:04:19.000', 'Jun 12, 2023 @ 00:04:19.000',
'Jul 12, 2019 @ 23:45:36.000' 'Jul 12, 2023 @ 23:45:36.000'
); );
await ml.testExecution.logTestStep('job creation displays the event rate chart'); await ml.testExecution.logTestStep('job creation displays the event rate chart');
@ -264,8 +264,8 @@ export default function ({ getService }: FtrProviderContext) {
await ml.testExecution.logTestStep('job cloning sets the time range'); await ml.testExecution.logTestStep('job cloning sets the time range');
await ml.jobWizardCommon.clickUseFullDataButton( await ml.jobWizardCommon.clickUseFullDataButton(
'Jun 12, 2019 @ 00:04:19.000', 'Jun 12, 2023 @ 00:04:19.000',
'Jul 12, 2019 @ 23:45:36.000' 'Jul 12, 2023 @ 23:45:36.000'
); );
await ml.testExecution.logTestStep('job cloning displays the event rate chart'); await ml.testExecution.logTestStep('job cloning displays the event rate chart');

View file

@ -213,9 +213,9 @@ export default function ({ getService }: FtrProviderContext) {
transformPreview: { transformPreview: {
column: 0, column: 0,
values: [ values: [
'July 12th 2019, 23:06:43', 'July 12th 2023, 23:06:43',
'July 12th 2019, 23:31:12', 'July 12th 2023, 23:31:12',
'July 12th 2019, 23:45:36', 'July 12th 2023, 23:45:36',
], ],
}, },
retentionPolicySwitchEnabled: false, retentionPolicySwitchEnabled: false,

View file

@ -93,6 +93,10 @@ export default function ({ getService }: FtrProviderContext) {
}, },
discoverAdjustSuperDatePicker: true, discoverAdjustSuperDatePicker: true,
expected: { expected: {
fullTimeRange: {
start: 'Jun 12, 2023 @ 00:04:19.000',
end: 'Jul 12, 2023 @ 23:45:36.000',
},
pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "category": {'], pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "category": {'],
pivotAdvancedEditorValue: { pivotAdvancedEditorValue: {
group_by: { group_by: {
@ -289,6 +293,10 @@ export default function ({ getService }: FtrProviderContext) {
}, },
discoverAdjustSuperDatePicker: false, discoverAdjustSuperDatePicker: false,
expected: { expected: {
fullTimeRange: {
start: 'Jun 12, 2023 @ 00:04:19.000',
end: 'Jul 12, 2023 @ 23:45:36.000',
},
pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "geoip.country_iso_code": {'], pivotAdvancedEditorValueArr: ['{', ' "group_by": {', ' "geoip.country_iso_code": {'],
pivotAdvancedEditorValue: { pivotAdvancedEditorValue: {
group_by: { group_by: {
@ -361,6 +369,10 @@ export default function ({ getService }: FtrProviderContext) {
destinationDataViewTimeField: 'order_date', destinationDataViewTimeField: 'order_date',
discoverAdjustSuperDatePicker: true, discoverAdjustSuperDatePicker: true,
expected: { expected: {
fullTimeRange: {
start: 'Jun 12, 2023 @ 00:04:19.000',
end: 'Jul 12, 2023 @ 23:45:36.000',
},
latestPreview: { latestPreview: {
column: 0, column: 0,
values: [], values: [],
@ -377,11 +389,11 @@ export default function ({ getService }: FtrProviderContext) {
transformPreview: { transformPreview: {
column: 0, column: 0,
values: [ values: [
'July 12th 2019, 22:16:19', 'July 12th 2023, 22:16:19',
'July 12th 2019, 22:50:53', 'July 12th 2023, 22:50:53',
'July 12th 2019, 23:06:43', 'July 12th 2023, 23:06:43',
'July 12th 2019, 23:15:22', 'July 12th 2023, 23:15:22',
'July 12th 2019, 23:31:12', 'July 12th 2023, 23:31:12',
], ],
}, },
discoverQueryHits: '10', discoverQueryHits: '10',

View file

@ -67,10 +67,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
let testJobId = ''; let testJobId = '';
// Failing: See https://github.com/elastic/kibana/issues/102012 describe('anomaly detection alert', function () {
describe.skip('anomaly detection alert', function () {
this.tags('ciGroup13');
before(async () => { before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce'); await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');

View file

@ -11,10 +11,8 @@ export default ({ loadTestFile, getService }: FtrProviderContext) => {
const ml = getService('ml'); const ml = getService('ml');
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
// FLAKY: https://github.com/elastic/kibana/issues/186285 describe('ML app', function () {
// FLAKY: https://github.com/elastic/kibana/issues/186286 this.tags(['mlqa', 'skipFirefox', 'ciGroup14']);
describe.skip('ML app', function () {
this.tags(['mlqa', 'skipFirefox']);
before(async () => { before(async () => {
await ml.securityCommon.createMlRoles(); await ml.securityCommon.createMlRoles();