Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use downsampled farequote archive #3

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions x-pack/test/functional/apps/ml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await ml.securityCommon.cleanMlRoles();

await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "index",
"value": {
"aliases": {
},
"index": "ft_farequote_small",
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"airline": {
"type": "keyword"
},
"responsetime": {
"type": "float"
},
"sourcetype": {
"type": "keyword"
},
"type": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "1"
}
}
}
}
34 changes: 22 additions & 12 deletions x-pack/test/functional/services/ml/test_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
return createResponse.id;
},

async createSavedSearchIfNeeded(savedSearch: any): Promise<string> {
async createSavedSearchIfNeeded(savedSearch: any, indexPatternTitle: string): Promise<string> {
const title = savedSearch.requestBody.attributes.title;
const savedSearchId = await this.getSavedSearchId(title);
if (savedSearchId !== undefined) {
Expand All @@ -195,7 +195,7 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
} else {
const body = await this.updateSavedSearchRequestBody(
savedSearch.requestBody,
savedSearch.indexPatternTitle
indexPatternTitle
);
return await this.createSavedSearch(title, body);
}
Expand Down Expand Up @@ -226,8 +226,8 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
return updatedBody;
},

async createSavedSearchFarequoteFilterIfNeeded() {
await this.createSavedSearchIfNeeded(savedSearches.farequoteFilter);
async createSavedSearchFarequoteFilterIfNeeded(indexPatternTitle: string = 'ft_farequote') {
await this.createSavedSearchIfNeeded(savedSearches.farequoteFilter, indexPatternTitle);
},

async createMLTestDashboardIfNeeded() {
Expand All @@ -249,20 +249,30 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
}
},

async createSavedSearchFarequoteLuceneIfNeeded() {
await this.createSavedSearchIfNeeded(savedSearches.farequoteLucene);
async createSavedSearchFarequoteLuceneIfNeeded(indexPatternTitle: string = 'ft_farequote') {
await this.createSavedSearchIfNeeded(savedSearches.farequoteLucene, indexPatternTitle);
},

async createSavedSearchFarequoteKueryIfNeeded() {
await this.createSavedSearchIfNeeded(savedSearches.farequoteKuery);
async createSavedSearchFarequoteKueryIfNeeded(indexPatternTitle: string = 'ft_farequote') {
await this.createSavedSearchIfNeeded(savedSearches.farequoteKuery, indexPatternTitle);
},

async createSavedSearchFarequoteFilterAndLuceneIfNeeded() {
await this.createSavedSearchIfNeeded(savedSearches.farequoteFilterAndLucene);
async createSavedSearchFarequoteFilterAndLuceneIfNeeded(
indexPatternTitle: string = 'ft_farequote'
) {
await this.createSavedSearchIfNeeded(
savedSearches.farequoteFilterAndLucene,
indexPatternTitle
);
},

async createSavedSearchFarequoteFilterAndKueryIfNeeded() {
await this.createSavedSearchIfNeeded(savedSearches.farequoteFilterAndKuery);
async createSavedSearchFarequoteFilterAndKueryIfNeeded(
indexPatternTitle: string = 'ft_farequote'
) {
await this.createSavedSearchIfNeeded(
savedSearches.farequoteFilterAndKuery,
indexPatternTitle
);
},

async deleteSavedObjectById(id: string, objectType: SavedObjectType, force: boolean = false) {
Expand Down
5 changes: 0 additions & 5 deletions x-pack/test/functional/services/ml/test_resources_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

export const savedSearches = {
farequoteFilter: {
indexPatternTitle: 'ft_farequote',
requestBody: {
attributes: {
title: 'ft_farequote_filter',
Expand Down Expand Up @@ -66,7 +65,6 @@ export const savedSearches = {
},
},
farequoteLucene: {
indexPatternTitle: 'ft_farequote',
requestBody: {
attributes: {
title: 'ft_farequote_lucene',
Expand Down Expand Up @@ -98,7 +96,6 @@ export const savedSearches = {
},
},
farequoteKuery: {
indexPatternTitle: 'ft_farequote',
requestBody: {
attributes: {
title: 'ft_farequote_kuery',
Expand Down Expand Up @@ -130,7 +127,6 @@ export const savedSearches = {
},
},
farequoteFilterAndLucene: {
indexPatternTitle: 'ft_farequote',
requestBody: {
attributes: {
title: 'ft_farequote_filter_and_lucene',
Expand Down Expand Up @@ -189,7 +185,6 @@ export const savedSearches = {
},
},
farequoteFilterAndKuery: {
indexPatternTitle: 'ft_farequote',
requestBody: {
attributes: {
title: 'ft_farequote_filter_and_kuery',
Expand Down