[ML] Functional tests - only check expected fields in jobs_summary response (#123939)

This PR fixes the jobs_summary API tests for the `7.latest ES 8.1 forward compatibility` scenario by making it only check expected fields in the response body and ignore additional fields that are coming from the newer ES version.
This commit is contained in:
Robert Oskamp 2022-01-28 13:51:25 +01:00 committed by GitHub
parent 59d5addac5
commit 13e7c8a1e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,9 +197,6 @@ export default ({ getService }: FtrProviderContext) => {
}
describe('jobs_summary', function () {
// FAILING Kibana 7.17 + ES 8.1 compatibility tests: https://github.com/elastic/kibana/issues/123851
this.onlyEsVersion('<8.1');
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.setKibanaTimeZoneToUTC();
@ -306,7 +303,10 @@ export default ({ getService }: FtrProviderContext) => {
if (expectedJob.fullJob) {
expect(actualJob).to.have.property('fullJob');
expect(actualJob.fullJob).to.have.property('analysis_config');
expect(actualJob.fullJob.analysis_config).to.eql(expectedJob.fullJob.analysis_config);
// only validate the expected parts of the analysis_config, ignore additional fields
for (const [key, value] of Object.entries(expectedJob.fullJob.analysis_config)) {
expect(actualJob.fullJob.analysis_config).to.have.property(key).eql(value);
}
} else {
expect(actualJob).not.to.have.property('fullJob');
}