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

[data.indexPatterns] Fix broken rollup index pattern creation #76593

Merged
merged 2 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class IndexPattern implements IIndexPattern {
fields: this.mapping.fields._serialize!(this.fields),
fieldFormatMap: this.mapping.fieldFormatMap._serialize!(this.fieldFormatMap),
type: this.type,
typeMeta: this.mapping.typeMeta._serialize!(this.mapping),
typeMeta: this.mapping.typeMeta._serialize!(this.typeMeta),
};
}

Expand Down
8 changes: 6 additions & 2 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,15 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
await PageObjects.header.waitUntilLoadingHasFinished();
}

async clickIndexPatternLogstash() {
const indexLink = await find.byXPath(`//a[descendant::*[text()='logstash-*']]`);
async clickIndexPatternByName(name: string) {
const indexLink = await find.byXPath(`//a[descendant::*[text()='${name}']]`);
await indexLink.click();
}

async clickIndexPatternLogstash() {
await this.clickIndexPatternByName('logstash-*');
}

async getIndexPatternList() {
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
return await find.allByCssSelector(
Expand Down
10 changes: 10 additions & 0 deletions x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import mockRolledUpData, { mockIndices } from './hybrid_index_helper';
export default function ({ getService, getPageObjects }) {
const es = getService('legacyEs');
const esArchiver = getService('esArchiver');
const find = getService('find');
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'settings']);

Expand Down Expand Up @@ -88,6 +89,15 @@ export default function ({ getService, getPageObjects }) {
(i) => i.includes(rollupIndexPatternName) && i.includes('Rollup')
);
expect(filteredIndexPatternNames.length).to.be(1);

// make sure there are no toasts which might be showing unexpected errors
const toastShown = await find.existsByCssSelector('.euiToast');
expect(toastShown).to.be(false);

// ensure all fields are available
await PageObjects.settings.clickIndexPatternByName(rollupIndexPatternName);
const fields = await PageObjects.settings.getFieldNames();
expect(fields).to.eql(['_source', '_id', '_type', '_index', '_score', '@timestamp']);
});

after(async () => {
Expand Down