[ML] Functional tests - stabilize categorization examples endpoint test (#115910)

This PR stabilizes the categorization example endpoint tests by using a different esArchive.
This commit is contained in:
Robert Oskamp 2021-10-21 17:11:24 +02:00 committed by GitHub
parent 5890a01896
commit 729481ed59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 2 deletions

View file

@ -44,6 +44,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_apache');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_auditbeat');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_apm');

View file

@ -64,7 +64,7 @@ const analyzer = {
],
};
const defaultRequestBody = {
indexPatternTitle: 'ft_categorization',
indexPatternTitle: 'ft_categorization_small',
query: { bool: { must: [{ match_all: {} }] } },
size: 5,
timeField: '@timestamp',
@ -286,7 +286,7 @@ export default ({ getService }: FtrProviderContext) => {
describe('Categorization example endpoint - ', function () {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/categorization');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/categorization_small');
await ml.testResources.setKibanaTimeZoneToUTC();
});

View file

@ -0,0 +1,41 @@
{
"type": "index",
"value": {
"aliases": {},
"index": "ft_categorization_small",
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"field1": {
"type": "text"
},
"field2": {
"type": "text"
},
"field3": {
"type": "text"
},
"field4": {
"type": "text"
},
"field5": {
"type": "text"
},
"field6": {
"type": "text"
},
"field7": {
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}