mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[8.x] Fix index templates api integration tests (#214958)
Fixes https://github.com/elastic/kibana/issues/209027 ## Summary This PR updates the 8.x index templates API integration tests to fix the failures in the 8.x -> 9.0 forward compatibility tests. To run the forward-compatibility tests locally: ``` ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/9.0.0/manifest-latest-verified.json" node scripts/functional_tests_server.js --config ./x-pack/test/api_integration/apis/management/config.ts ``` and ``` ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/9.0.0/manifest-latest-verified.json" node scripts/functional_test_runner.js --config ./x-pack/test/api_integration/apis/management/config.ts --grep="index templates" ```
This commit is contained in:
parent
db7277d162
commit
2b6ad467f3
1 changed files with 22 additions and 6 deletions
|
@ -16,6 +16,7 @@ import { getRandomString } from './lib/random';
|
|||
export default function ({ getService }: FtrProviderContext) {
|
||||
const log = getService('log');
|
||||
const es = getService('es');
|
||||
const esVersion = getService('esVersion');
|
||||
const { catTemplate, getTemplatePayload, getSerializedTemplate } = templatesHelpers(getService);
|
||||
const {
|
||||
getAllTemplates,
|
||||
|
@ -246,14 +247,26 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await deleteTemplates([{ name: logsdbTemplateName }]);
|
||||
});
|
||||
|
||||
const logsdbSettings: Array<{ enabled: boolean | null; indexMode: string }> = [
|
||||
{ enabled: true, indexMode: 'logsdb' },
|
||||
{ enabled: false, indexMode: 'standard' },
|
||||
{ enabled: null, indexMode: 'standard' }, // In stateful Kibana, the cluster.logsdb.enabled setting is false by default, so standard index mode
|
||||
const logsdbSettings: Array<{
|
||||
enabled: boolean | null;
|
||||
prior_logs_usage: boolean;
|
||||
indexMode: string;
|
||||
}> = [
|
||||
{ enabled: true, prior_logs_usage: true, indexMode: 'logsdb' },
|
||||
{ enabled: false, prior_logs_usage: true, indexMode: 'standard' },
|
||||
// In stateful Kibana, when cluster.logsb.enabled setting is not set, the index mode is always standard
|
||||
// For versions 9.0+, if prior_logs_usage is set to false, the cluster.logsdb.enabled setting is true by default, so logsdb index mode
|
||||
{ enabled: null, prior_logs_usage: true, indexMode: 'standard' },
|
||||
{
|
||||
enabled: null,
|
||||
prior_logs_usage: false,
|
||||
indexMode: esVersion.matchRange('>=9.0.0') ? 'logsdb' : 'standard',
|
||||
},
|
||||
];
|
||||
|
||||
logsdbSettings.forEach(({ enabled, indexMode }) => {
|
||||
it(`returns ${indexMode} index mode if logsdb.enabled setting is ${enabled}`, async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
logsdbSettings.forEach(({ enabled, prior_logs_usage, indexMode }) => {
|
||||
it(`returns ${indexMode} index mode if logsdb.enabled setting is ${enabled} and logs.prior_logs_usage is ${prior_logs_usage}`, async () => {
|
||||
await es.cluster.putSettings({
|
||||
body: {
|
||||
persistent: {
|
||||
|
@ -262,6 +275,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
enabled,
|
||||
},
|
||||
},
|
||||
logsdb: {
|
||||
prior_logs_usage,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue