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

[master] Fix esArchiver path in the Jenkins workspace #102095

Merged
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 @@ -6,8 +6,14 @@
*/

import expect from '@kbn/expect';
import { resolve } from 'path';
import { REPO_ROOT } from '@kbn/dev-utils';

const ARCHIVE = '../integration-test/test/es_archives/email_connectors_with_encryption_rotation';
const INTEGRATION_TEST_ROOT = process.env.WORKSPACE || resolve(REPO_ROOT, '../integration-test');
const ARCHIVE = resolve(
INTEGRATION_TEST_ROOT,
'test/es_archives/email_connectors_with_encryption_rotation'
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these existing tests shouldn't need this change because they're loading data into the local cluster and esArchive already works for that. This test gets the correct path because of the INTEGRATION_TEST_ROOT defined in the config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no more esArchive path in the config.


export default ({ getPageObjects, getService }) => {
const esArchiver = getService('esArchiver');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
*/

import fs from 'fs';
import { resolve } from 'path';
import expect from '@kbn/expect';
import { Client as EsClient } from '@elastic/elasticsearch';
import { KbnClient } from '@kbn/test';
import { EsArchiver } from '@kbn/es-archiver';
import { CA_CERT_PATH } from '@kbn/dev-utils';
import { CA_CERT_PATH, REPO_ROOT } from '@kbn/dev-utils';

const INTEGRATION_TEST_ROOT = process.env.WORKSPACE || resolve(REPO_ROOT, '../integration-test');
const ARCHIVE = resolve(INTEGRATION_TEST_ROOT, 'test/es_archives/metricbeat');

export default ({ getService, getPageObjects }) => {
describe('Cross cluster search test in discover', async () => {
Expand Down Expand Up @@ -261,7 +265,7 @@ export default ({ getService, getPageObjects }) => {

before('Prepare data:metricbeat-*', async function () {
log.info('Create index');
await esArchiver.load('../integration-test/test/es_archives/metricbeat');
await esArchiver.load(ARCHIVE);

log.info('Create index pattern');
dataId = await supertest
Expand Down Expand Up @@ -321,7 +325,7 @@ export default ({ getService, getPageObjects }) => {
}

log.info('Delete index');
await esArchiver.unload('../integration-test/test/es_archives/metricbeat');
await esArchiver.unload(ARCHIVE);
});

after('Clean up .siem-signal-*', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
*/

import expect from '@kbn/expect';
import { resolve } from 'path';
import { REPO_ROOT } from '@kbn/dev-utils';

const INTEGRATION_TEST_ROOT = process.env.WORKSPACE || resolve(REPO_ROOT, '../integration-test');
const ARCHIVE = resolve(INTEGRATION_TEST_ROOT, 'test/es_archives/metricbeat');

export default function ({ getService, getPageObjects, updateBaselines }) {
const screenshot = getService('screenshots');
Expand All @@ -15,7 +20,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {

describe('check metricbeat Dashboard', function () {
before(async function () {
await esArchiver.load('../integration-test/test/es_archives/metricbeat');
await esArchiver.load(ARCHIVE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need any change here. The current version that just does await esArchiver.load('metricbeat'); should work both locally and in Jenkins.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await esArchiver.load('metricbeat'); does not work any more after #101345, a path relative to kibana/ or an absolute path is now needed.


// this navigateToActualURL takes the place of navigating to the dashboard landing page,
// filtering on the dashboard name, selecting it, setting the timepicker, and going to full screen
Expand Down Expand Up @@ -45,7 +50,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {
});

after(async function () {
await esArchiver.unload('../integration-test/test/es_archives/metricbeat');
await esArchiver.unload(ARCHIVE);
});

it('[Metricbeat System] Overview ECS should match snapshot', async function () {
Expand Down