Skip to content

Commit

Permalink
[7.17][Rollup] Unskip 7.17 rollup functional tests (#187350)
Browse files Browse the repository at this point in the history
Fixes #184229
Fixes #184230
Fixes #184277
Fixes #184278
Fixes #184357
Fixes #57065

## Summary

This PR unskips the 7.17 rollup functional tests which failed during the
7.17 ES 8.15 forward compatibility tests.

To run the tests locally with ES 8.15:

```
ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/8.15.0/manifest-latest-verified.json" node scripts/functional_tests_server.js --config x-pack/test/functional/config.js
```

```
ES_SNAPSHOT_MANIFEST="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/8.15.0/manifest-latest-verified.json" node scripts/functional_test_runner.js --config x-pack/test/functional/config.js --grep="rollup job"

```

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Alison Goryachev <[email protected]>
  • Loading branch information
3 people authored Jul 15, 2024
1 parent 8197581 commit 05f4e98
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 11 deletions.
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.x 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

0 comments on commit 05f4e98

Please sign in to comment.