-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] Functional tests for async search (#78703)
* [Search] [WIP] Add shard delay aggregation * Add expression functions * Register function * Fix test * Add comment * [Search] Add async search functional tests * Add import * Add additional test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
cc784a0
commit 25b1db1
Showing
8 changed files
with
521 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
x-pack/test/functional/apps/dashboard/async_search/async_search.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['common', 'header', 'dashboard', 'visChart']); | ||
|
||
describe('dashboard with async search', () => { | ||
it('not delayed should load', async () => { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.gotoDashboardEditMode('Not Delayed'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.missingOrFail('embeddableErrorLabel'); | ||
const data = await PageObjects.visChart.getBarChartData('Sum of bytes'); | ||
expect(data.length).to.be(5); | ||
}); | ||
|
||
it('delayed should load', async () => { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.gotoDashboardEditMode('Delayed 5s'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.missingOrFail('embeddableErrorLabel'); | ||
const data = await PageObjects.visChart.getBarChartData(''); | ||
expect(data.length).to.be(5); | ||
}); | ||
|
||
it('timed out should show error', async () => { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.gotoDashboardEditMode('Delayed 15s'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
await testSubjects.existOrFail('embeddableErrorLabel'); | ||
await testSubjects.existOrFail('searchTimeoutError'); | ||
}); | ||
}); | ||
} |
26 changes: 26 additions & 0 deletions
26
x-pack/test/functional/apps/dashboard/async_search/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile, getService }: FtrProviderContext) { | ||
const kibanaServer = getService('kibanaServer'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
describe('async search', function () { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
await esArchiver.load('dashboard/async_search'); | ||
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); | ||
await kibanaServer.uiSettings.replace({ 'search:timeout': 10000 }); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('dashboard/async_search'); | ||
}); | ||
|
||
loadTestFile(require.resolve('./async_search')); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
197 changes: 197 additions & 0 deletions
197
x-pack/test/functional/es_archives/dashboard/async_search/data.json
Large diffs are not rendered by default.
Oops, something went wrong.
244 changes: 244 additions & 0 deletions
244
x-pack/test/functional/es_archives/dashboard/async_search/mappings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
{ | ||
"type": "index", | ||
"value": { | ||
"index": ".kibana", | ||
"mappings": { | ||
"properties": { | ||
"config": { | ||
"dynamic": "true", | ||
"properties": { | ||
"buildNum": { | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
"dashboard": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"description": { | ||
"type": "text" | ||
}, | ||
"hits": { | ||
"type": "integer" | ||
}, | ||
"kibanaSavedObjectMeta": { | ||
"properties": { | ||
"searchSourceJSON": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"optionsJSON": { | ||
"type": "text" | ||
}, | ||
"panelsJSON": { | ||
"type": "text" | ||
}, | ||
"refreshInterval": { | ||
"properties": { | ||
"display": { | ||
"type": "keyword" | ||
}, | ||
"pause": { | ||
"type": "boolean" | ||
}, | ||
"section": { | ||
"type": "integer" | ||
}, | ||
"value": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"timeFrom": { | ||
"type": "keyword" | ||
}, | ||
"timeRestore": { | ||
"type": "boolean" | ||
}, | ||
"timeTo": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
}, | ||
"uiStateJSON": { | ||
"type": "text" | ||
}, | ||
"version": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"index-pattern": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"fieldFormatMap": { | ||
"type": "text" | ||
}, | ||
"fields": { | ||
"type": "text" | ||
}, | ||
"intervalName": { | ||
"type": "keyword" | ||
}, | ||
"notExpandable": { | ||
"type": "boolean" | ||
}, | ||
"sourceFilters": { | ||
"type": "text" | ||
}, | ||
"timeFieldName": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"search": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"columns": { | ||
"type": "keyword" | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"hits": { | ||
"type": "integer" | ||
}, | ||
"kibanaSavedObjectMeta": { | ||
"properties": { | ||
"searchSourceJSON": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"sort": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
}, | ||
"version": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"server": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"uuid": { | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
"timelion-sheet": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"description": { | ||
"type": "text" | ||
}, | ||
"hits": { | ||
"type": "integer" | ||
}, | ||
"kibanaSavedObjectMeta": { | ||
"properties": { | ||
"searchSourceJSON": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"timelion_chart_height": { | ||
"type": "integer" | ||
}, | ||
"timelion_columns": { | ||
"type": "integer" | ||
}, | ||
"timelion_interval": { | ||
"type": "keyword" | ||
}, | ||
"timelion_other_interval": { | ||
"type": "keyword" | ||
}, | ||
"timelion_rows": { | ||
"type": "integer" | ||
}, | ||
"timelion_sheet": { | ||
"type": "text" | ||
}, | ||
"title": { | ||
"type": "text" | ||
}, | ||
"version": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"type": { | ||
"type": "keyword" | ||
}, | ||
"url": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"accessCount": { | ||
"type": "long" | ||
}, | ||
"accessDate": { | ||
"type": "date" | ||
}, | ||
"createDate": { | ||
"type": "date" | ||
}, | ||
"url": { | ||
"fields": { | ||
"keyword": { | ||
"ignore_above": 2048, | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"visualization": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"description": { | ||
"type": "text" | ||
}, | ||
"kibanaSavedObjectMeta": { | ||
"properties": { | ||
"searchSourceJSON": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"savedSearchId": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
}, | ||
"uiStateJSON": { | ||
"type": "text" | ||
}, | ||
"version": { | ||
"type": "integer" | ||
}, | ||
"visState": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"index": { | ||
"number_of_replicas": "1", | ||
"number_of_shards": "1" | ||
} | ||
} | ||
} | ||
} |