Skip to content

Commit

Permalink
[test] Updates rollup test to allow incoming doc_count field mapper (#…
Browse files Browse the repository at this point in the history
…82547)

* [test] Updates rollup test to allow incoming doc_count field mapper

A doc_count field mapper was added in
elastic/elasticsearch#64503

This is currently failing the ES promotion. After this promotion, we can
go back and update this test to be an exact match on the body if we
think that is the desired assertion.

Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley authored Nov 4, 2020
1 parent b8307b4 commit 286dbca
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions x-pack/test/api_integration/apis/management/rollup/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ export default function ({ getService }) {

const { body } = await supertest.get(uri).expect(200);

expect(body).to.eql({
dateFields: ['testCreatedField'],
keywordFields: ['testTagField'],
numericFields: ['testTotalField'],
doesMatchIndices: true,
doesMatchRollupIndices: false,
});
expect(Object.keys(body)).to.eql([
'doesMatchIndices',
'doesMatchRollupIndices',
'dateFields',
'numericFields',
'keywordFields',
]);

expect(body.doesMatchIndices).to.be(true);
expect(body.doesMatchRollupIndices).to.be(false);
expect(body.dateFields).to.eql(['testCreatedField']);
expect(body.keywordFields).to.eql(['testTagField']);

// Allowing the test to account for future addition of doc_count
expect(body.numericFields.indexOf('testTotalField')).to.be.greaterThan(-1);
});

it("should not return any fields when the index pattern doesn't match any indices", async () => {
Expand Down

0 comments on commit 286dbca

Please sign in to comment.