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

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.

(cherry picked from commit 13e7c8a1e2)
This commit is contained in:
Robert Oskamp 2022-01-28 15:31:52 +01:00 committed by GitHub
parent 5f963e13ee
commit 8f8b91e8ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -303,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');
}