Skip to content

Commit

Permalink
Fix esArchiver path in the Jenkins context (#102095)
Browse files Browse the repository at this point in the history
  • Loading branch information
cavokz committed Jun 14, 2021
1 parent df89ece commit 8bdc0d7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
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'
);

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);

// 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

0 comments on commit 8bdc0d7

Please sign in to comment.