Skip to content

Commit

Permalink
[Index Management] Skip failing test for forward compatibility scena…
Browse files Browse the repository at this point in the history
…rio (#211219)
  • Loading branch information
sabarasaba authored Feb 18, 2025
1 parent 4b36047 commit 75ea191
Showing 1 changed file with 100 additions and 69 deletions.
169 changes: 100 additions & 69 deletions x-pack/test/api_integration/apis/management/index_management/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,76 +18,107 @@ export default function ({ getService }: FtrProviderContext) {
describe('settings', () => {
after(async () => await deleteAllIndices());

it('should fetch an index settings', async () => {
const index = await createIndex();
const expectedIndexSettings = [
'max_inner_result_window',
'unassigned',
'max_terms_count',
'lifecycle',
'routing_partition_size',
'max_docvalue_fields_search',
'merge',
'max_refresh_listeners',
'max_regex_length',
'load_fixed_bitset_filters_eagerly',
'number_of_routing_shards',
'write',
'verified_before_close',
'mapping',
'source_only',
'soft_deletes',
'max_script_fields',
'query',
'format',
'frozen',
'sort',
'priority',
'codec',
'max_rescore_window',
'analyze',
'gc_deletes',
'max_ngram_diff',
'translog',
'auto_expand_replicas',
'requests',
'data_path',
'highlight',
'routing',
'search',
'fielddata',
'default_pipeline',
'max_slices_per_scroll',
'shard',
'xpack',
'percolator',
'allocation',
'refresh_interval',
'indexing',
'compound_format',
'blocks',
'max_result_window',
'store',
'queries',
'warmer',
'max_shingle_diff',
'query_string',
];

describe('8.x specific tests', function () {
this.onlyEsVersion('8');

it('should fetch an index settings', async function () {
const index = await createIndex();

const { status, body } = await getIndexSettings(index);
expect(status).to.eql(200);

// Verify we fetch the corret index settings
expect(body.settings.index.provided_name).to.be(index);

// Make sure none of the settings have been removed from ES API
expectedIndexSettings.forEach((setting) => {
try {
expect(Object.hasOwn(body.defaults.index, setting)).to.be(true);
} catch {
throw new Error(`Expected setting "${setting}" not found.`);
}
});
});
});

describe('Forward compatibility with 9.x', function () {
this.onlyEsVersion('>=9');

it('should fetch an index settings', async () => {
const indexSettingsNotIn9 = ['frozen'];

const index = await createIndex();

const { status, body } = await getIndexSettings(index);
expect(status).to.eql(200);

// Verify we fetch the corret index settings
expect(body.settings.index.provided_name).to.be(index);

const { status, body } = await getIndexSettings(index);
expect(status).to.eql(200);

// Verify we fetch the corret index settings
expect(body.settings.index.provided_name).to.be(index);

const expectedSettings = [
'max_inner_result_window',
'unassigned',
'max_terms_count',
'lifecycle',
'routing_partition_size',
'max_docvalue_fields_search',
'merge',
'max_refresh_listeners',
'max_regex_length',
'load_fixed_bitset_filters_eagerly',
'number_of_routing_shards',
'write',
'verified_before_close',
'mapping',
'source_only',
'soft_deletes',
'max_script_fields',
'query',
'format',
'frozen',
'sort',
'priority',
'codec',
'max_rescore_window',
'analyze',
'gc_deletes',
'max_ngram_diff',
'translog',
'auto_expand_replicas',
'requests',
'data_path',
'highlight',
'routing',
'search',
'fielddata',
'default_pipeline',
'max_slices_per_scroll',
'shard',
'xpack',
'percolator',
'allocation',
'refresh_interval',
'indexing',
'compound_format',
'blocks',
'max_result_window',
'store',
'queries',
'warmer',
'max_shingle_diff',
'query_string',
];

// Make sure none of the settings have been removed from ES API
expectedSettings.forEach((setting) => {
try {
expect(Object.hasOwn(body.defaults.index, setting)).to.be(true);
} catch {
throw new Error(`Expected setting "${setting}" not found.`);
}
// Make sure none of the settings have been removed from ES API
expectedIndexSettings
.filter((setting) => !indexSettingsNotIn9.includes(setting))
.forEach((setting) => {
try {
expect(Object.hasOwn(body.defaults.index, setting)).to.be(true);
} catch {
throw new Error(`Expected setting "${setting}" not found.`);
}
});
});
});

Expand Down

0 comments on commit 75ea191

Please sign in to comment.