Skip to content

Commit

Permalink
Merge branch '7.17' into backport/7.17/pr-182683
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 10, 2024
2 parents 4f12546 + 8f04ab6 commit 3dd5211
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions x-pack/test/api_integration/apis/ml/indices/field_caps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ export default ({ getService }: FtrProviderContext) => {
return body;
}

// Failing: See https://github.com/elastic/kibana/issues/182837
describe.skip('field_caps', function () {
// Failing ES Forward Compatibility: https://github.com/elastic/kibana/issues/182514
this.onlyEsVersion('>=8');
describe('field_caps', function () {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
});
Expand Down Expand Up @@ -64,9 +61,16 @@ export default ({ getService }: FtrProviderContext) => {
`Expected number of indices to be 1, but got ${indices.length}`
);
const fieldsLength = Object.keys(fields).length;

// The number of fields returned by the field caps API is different across
// ES versions in forward compatibility tests. In ES 8.15.0, the `_ignored_source`
// field was added (https://github.com/elastic/elasticsearch/pull/107567).
const esVersion = getService('esVersion');
const expectedFieldsLength = esVersion.matchRange('>=8.15') ? 22 : 21;

expect(fieldsLength).to.eql(
21,
`Expected number of fields to be 21, but got ${fieldsLength}`
expectedFieldsLength,
`Expected number of fields to be ${expectedFieldsLength}, but got ${fieldsLength}`
);
});
});
Expand Down

0 comments on commit 3dd5211

Please sign in to comment.