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

[7.17][Rollup] Unskip 7.17 rollup functional tests #187350

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 8 additions & 3 deletions x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datemath from '@elastic/datemath';
import expect from '@kbn/expect';
import mockRolledUpData, { mockIndices } from './hybrid_index_helper';
import { MOCK_ROLLUP_INDEX_NAME, createMockRollupIndex } from './test_helpers';

export default function ({ getService, getPageObjects }) {
const es = getService('es');
Expand All @@ -17,9 +18,7 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['common', 'settings']);
const esDeleteAllIndices = getService('esDeleteAllIndices');

// Failing: See https://github.com/elastic/kibana/issues/184278
// Failing: See https://github.com/elastic/kibana/issues/184277
describe.skip('hybrid index pattern', function () {
describe('hybrid index pattern', function () {
//Since rollups can only be created once with the same name (even if you delete it),
//we add the Date.now() to avoid name collision if you run the tests locally back to back.
const rollupJobName = `hybrid-index-pattern-test-rollup-job-${Date.now()}`;
Expand All @@ -46,6 +45,11 @@ export default function ({ getService, getPageObjects }) {
await kibanaServer.uiSettings.replace({
defaultIndex: 'rollup',
});

// The step below is done for the 7.17 ES 8.15 forward compatibility tests
// From 8.15, Es only allows creating a new rollup job when there is existing rollup usage in the cluster
// We will simulate rollup usage by creating a mock-up rollup index
await createMockRollupIndex(es);
});

it('create hybrid index pattern', async () => {
Expand Down Expand Up @@ -121,6 +125,7 @@ export default function ({ getService, getPageObjects }) {
rollupTargetIndexName,
`${regularIndexPrefix}*`,
`${rollupSourceIndexPrefix}*`,
MOCK_ROLLUP_INDEX_NAME,
]);
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/rollup/rollup_hybrid'
Expand Down
12 changes: 8 additions & 4 deletions x-pack/test/functional/apps/rollup_job/rollup_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datemath from '@elastic/datemath';
import expect from '@kbn/expect';
import { mockIndices } from './hybrid_index_helper';
import { MOCK_ROLLUP_INDEX_NAME, createMockRollupIndex } from './test_helpers';

export default function ({ getService, getPageObjects }) {
const es = getService('es');
Expand All @@ -16,9 +17,7 @@ export default function ({ getService, getPageObjects }) {
const security = getService('security');
const esDeleteAllIndices = getService('esDeleteAllIndices');

// Failing: See https://github.com/elastic/kibana/issues/184230
// Failing: See https://github.com/elastic/kibana/issues/184229
describe.skip('rollup job', function () {
describe('rollup job', function () {
//Since rollups can only be created once with the same name (even if you delete it),
//we add the Date.now() to avoid name collision.
const rollupJobName = 'rollup-to-be-' + Date.now();
Expand All @@ -36,6 +35,11 @@ export default function ({ getService, getPageObjects }) {
before(async () => {
await security.testUser.setRoles(['manage_rollups_role']);
await PageObjects.common.navigateToApp('rollupJob');

// The step below is done for the 7.17 ES 8.15 forward compatibility tests
// From 8.15, Es only allows creating a new rollup job when there is existing rollup usage in the cluster
// We will simulate rollup usage by creating a mock-up rollup index
await createMockRollupIndex(es);
});

it('create new rollup job', async () => {
Expand Down Expand Up @@ -72,7 +76,7 @@ export default function ({ getService, getPageObjects }) {
});

//Delete all data indices that were created.
await esDeleteAllIndices([targetIndexName, rollupSourceIndexPattern]);
await esDeleteAllIndices([targetIndexName, rollupSourceIndexPattern, MOCK_ROLLUP_INDEX_NAME]);
await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana');
await security.testUser.restoreDefaults();
});
Expand Down
45 changes: 45 additions & 0 deletions x-pack/test/functional/apps/rollup_job/test_helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const MOCK_ROLLUP_INDEX_NAME = 'mock-rollup-index';

export const createMockRollupIndex = async (es) => {
await es.indices.create({
index: MOCK_ROLLUP_INDEX_NAME,
body: {
mappings: {
_meta: {
_rollup: {
logs_job: {
id: 'mockRollupJob',
index_pattern: MOCK_ROLLUP_INDEX_NAME,
rollup_index: 'rollup_index',
cron: '0 0 0 ? * 7',
page_size: 1000,
groups: {
date_histogram: {
interval: '24h',
delay: '1d',
time_zone: 'UTC',
field: 'testCreatedField',
},
terms: {
fields: ['testTotalField', 'testTagField'],
},
histogram: {
interval: '7',
fields: ['testTotalField'],
},
},
},
},
'rollup-version': '',
},
},
},
});
};
16 changes: 12 additions & 4 deletions x-pack/test/functional/apps/rollup_job/tsvb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import expect from '@kbn/expect';
import mockRolledUpData from './hybrid_index_helper';
import { MOCK_ROLLUP_INDEX_NAME, createMockRollupIndex } from './test_helpers';

export default function ({ getService, getPageObjects }) {
const es = getService('es');
Expand All @@ -22,9 +23,7 @@ export default function ({ getService, getPageObjects }) {
'timePicker',
]);

// Failing: See https://github.com/elastic/kibana/issues/57065
// Failing: See https://github.com/elastic/kibana/issues/184357
describe.skip('tsvb integration', function () {
describe('tsvb integration', function () {
//Since rollups can only be created once with the same name (even if you delete it),
//we add the Date.now() to avoid name collision if you run the tests locally back to back.
const rollupJobName = `tsvb-test-rollup-job-${Date.now()}`;
Expand All @@ -45,6 +44,11 @@ export default function ({ getService, getPageObjects }) {
await kibanaServer.uiSettings.replace({
defaultIndex: 'rollup',
});

// The step below is done for the 7.17 ES 8.15 forward compatibility tests
// From 8.15, Es only allows creating a new rollup job when there is existing rollup usage in the cluster
// We will simulate rollup usage by creating a mock-up rollup index
await createMockRollupIndex(es);
});

it('create rollup tsvb', async () => {
Expand Down Expand Up @@ -108,7 +112,11 @@ export default function ({ getService, getPageObjects }) {
method: 'DELETE',
});

await esDeleteAllIndices([rollupTargetIndexName, rollupSourceIndexName]);
await esDeleteAllIndices([
rollupTargetIndexName,
rollupSourceIndexName,
MOCK_ROLLUP_INDEX_NAME,
]);
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/rollup/rollup.json'
);
Expand Down