-
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.
Browse files
Browse the repository at this point in the history
…#78247) * Improve scripted field error handling * Add test to x-pack to prevent different rendering in different licenses * Add testdata
- Loading branch information
Showing
6 changed files
with
354 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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 esArchiver = getService('esArchiver'); | ||
const testSubjects = getService('testSubjects'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); | ||
|
||
describe('errors', function describeIndexTests() { | ||
before(async function () { | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
await esArchiver.load('invalid_scripted_field'); | ||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); | ||
await PageObjects.common.navigateToApp('discover'); | ||
}); | ||
|
||
after(async function () { | ||
await esArchiver.unload('invalid_scripted_field'); | ||
}); | ||
// this is the same test as in OSS but it catches different error message issue in different licences | ||
describe('invalid scripted field error', () => { | ||
it('is rendered', async () => { | ||
const isFetchErrorVisible = await testSubjects.exists('discoverFetchError'); | ||
expect(isFetchErrorVisible).to.be(true); | ||
}); | ||
}); | ||
}); | ||
} |
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
Binary file added
BIN
+956 Bytes
x-pack/test/functional/es_archives/invalid_scripted_field/data.json.gz
Binary file not shown.
250 changes: 250 additions & 0 deletions
250
x-pack/test/functional/es_archives/invalid_scripted_field/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,250 @@ | ||
{ | ||
"type": "index", | ||
"value": { | ||
"index": ".kibana", | ||
"mappings": { | ||
"dynamic": "strict", | ||
"properties": { | ||
"config": { | ||
"dynamic": "true", | ||
"properties": { | ||
"buildNum": { | ||
"type": "keyword" | ||
}, | ||
"defaultIndex": { | ||
"fields": { | ||
"keyword": { | ||
"ignore_above": 256, | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"dashboard": { | ||
"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": { | ||
"properties": { | ||
"fieldFormatMap": { | ||
"type": "text" | ||
}, | ||
"fields": { | ||
"type": "text" | ||
}, | ||
"intervalName": { | ||
"type": "keyword" | ||
}, | ||
"notExpandable": { | ||
"type": "boolean" | ||
}, | ||
"sourceFilters": { | ||
"type": "text" | ||
}, | ||
"timeFieldName": { | ||
"type": "keyword" | ||
}, | ||
"title": { | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"search": { | ||
"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": { | ||
"properties": { | ||
"uuid": { | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
"timelion-sheet": { | ||
"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" | ||
}, | ||
"updated_at": { | ||
"type": "date" | ||
}, | ||
"url": { | ||
"properties": { | ||
"accessCount": { | ||
"type": "long" | ||
}, | ||
"accessDate": { | ||
"type": "date" | ||
}, | ||
"createDate": { | ||
"type": "date" | ||
}, | ||
"url": { | ||
"fields": { | ||
"keyword": { | ||
"ignore_above": 2048, | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"visualization": { | ||
"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": "0", | ||
"number_of_shards": "1" | ||
} | ||
} | ||
} | ||
} |