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

[7.17] [UII] Adjust test based on ES version tested against (#195508) #195665

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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
57 changes: 34 additions & 23 deletions x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,34 +116,45 @@ export default function (providerContext: FtrProviderContext) {
// omit routings
delete body.template.settings.index.routing;

expect(body).to.eql({
template: {
settings: {
index: {
codec: 'best_compression',
lifecycle: {
name: 'overridden by user',
},
mapping: {
total_fields: {
limit: '10000',
},
expect(Object.keys(body)).to.eql(['template', 'overlapping']);
expect(body.template).to.eql({
settings: {
index: {
codec: 'best_compression',
lifecycle: {
name: 'overridden by user',
},
mapping: {
total_fields: {
limit: '10000',
},
number_of_shards: '3',
},
number_of_shards: '3',
},
mappings: {
dynamic: 'false',
},
aliases: {},
},
overlapping: [
{
name: 'logs',
index_patterns: ['logs-*-*'],
},
],
mappings: {
dynamic: 'false',
},
aliases: {},
});

// otel logs templates were added in 8.16 but these tests also run against
// previous versions, so we conditionally test based on the ES version
const esVersion = getService('esVersion');
expect(body.overlapping).to.eql([
{
name: 'logs',
index_patterns: ['logs-*-*'],
},
...(esVersion.matchRange('>=8.16.0')
? [
{
index_patterns: ['logs-*.otel-*'],
name: 'logs-otel@template',
},
]
: []),
]);
});
});
}
Loading