From 25c53a44b96446673deadcb7c5d9e7de41a5e210 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 1 Oct 2020 22:22:54 -0500 Subject: [PATCH 1/3] define integrationTestRoot in config file and use to define screenshots and esArchiver dirs --- .../apps/metricbeat/_metricbeat_dashboard.js | 3 +-- .../config.stack_functional_integration_base.js | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js index 42f707fb778547..0ce09e8f59d2d1 100644 --- a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js +++ b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js @@ -5,7 +5,6 @@ */ import expect from '@kbn/expect'; -import { REPO_ROOT } from '@kbn/dev-utils'; export default function ({ getService, getPageObjects, updateBaselines }) { const screenshot = getService('screenshots'); @@ -15,7 +14,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) { describe('check metricbeat Dashboard', function () { before(async function () { - await esArchiver.load(`${REPO_ROOT}/../integration-test/test/es_archives/metricbeat`); + await esArchiver.load('metricbeat'); // 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 diff --git a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js index a838b129242a15..7c71b1fa180d52 100644 --- a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js +++ b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js @@ -16,10 +16,17 @@ const log = new ToolingLog({ level: 'info', writeTo: process.stdout, }); +log.info(`REPO_ROOT = ${REPO_ROOT}`); log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`); -const stateFilePath = process.env.WORKSPACE - ? `${process.env.WORKSPACE}/qa/envvars.sh` - : `${REPO_ROOT}/../integration-test/qa/envvars.sh`; + +const integrationTestRoot = process.env.WORKSPACE + ? process.env.WORKSPACE + : `${REPO_ROOT}/../integration-test`; +log.info(`integrationTestRoot = ${integrationTestRoot}`); + +// const stateFilePath = resolve(integrationTestRoot, '/qa/envvars.sh'); +const stateFilePath = `${integrationTestRoot}/qa/envvars.sh`; +log.info(`stateFilePath = ${stateFilePath}`); const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`); @@ -46,11 +53,11 @@ export default async ({ readConfigFile }) => { security: { disableTestUser: true }, // choose where screenshots should be saved screenshots: { - directory: resolve(`${REPO_ROOT}/../integration-test`, 'test/screenshots'), + directory: resolve(integrationTestRoot, 'test/screenshots'), }, // choose where esArchiver should load archives from esArchiver: { - directory: resolve(`${REPO_ROOT}/../integration-test`, 'test/es_archives'), + directory: resolve(integrationTestRoot, 'test/es_archives'), }, }; return settings; From 174cb9983fba99bda0f10c08519058337c4b0654 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 1 Oct 2020 22:29:25 -0500 Subject: [PATCH 2/3] rename to INTEGRATION_TEST_ROOT --- .../config.stack_functional_integration_base.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js index 7c71b1fa180d52..132788262bb29c 100644 --- a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js +++ b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js @@ -19,13 +19,13 @@ const log = new ToolingLog({ log.info(`REPO_ROOT = ${REPO_ROOT}`); log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`); -const integrationTestRoot = process.env.WORKSPACE +const INTEGRATION_TEST_ROOT = process.env.WORKSPACE ? process.env.WORKSPACE : `${REPO_ROOT}/../integration-test`; -log.info(`integrationTestRoot = ${integrationTestRoot}`); +log.info(`integrationTestRoot = ${INTEGRATION_TEST_ROOT}`); // const stateFilePath = resolve(integrationTestRoot, '/qa/envvars.sh'); -const stateFilePath = `${integrationTestRoot}/qa/envvars.sh`; +const stateFilePath = `${INTEGRATION_TEST_ROOT}/qa/envvars.sh`; log.info(`stateFilePath = ${stateFilePath}`); const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`); @@ -53,11 +53,11 @@ export default async ({ readConfigFile }) => { security: { disableTestUser: true }, // choose where screenshots should be saved screenshots: { - directory: resolve(integrationTestRoot, 'test/screenshots'), + directory: resolve(INTEGRATION_TEST_ROOT, 'test/screenshots'), }, // choose where esArchiver should load archives from esArchiver: { - directory: resolve(integrationTestRoot, 'test/es_archives'), + directory: resolve(INTEGRATION_TEST_ROOT, 'test/es_archives'), }, }; return settings; From 352d27368c4c791ad539123604230c4a3c07d808 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Fri, 2 Oct 2020 15:36:59 -0500 Subject: [PATCH 3/3] update from review comments --- .../configs/config.stack_functional_integration_base.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js index 132788262bb29c..bc5b28641c28c2 100644 --- a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js +++ b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js @@ -19,13 +19,10 @@ const log = new ToolingLog({ log.info(`REPO_ROOT = ${REPO_ROOT}`); log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`); -const INTEGRATION_TEST_ROOT = process.env.WORKSPACE - ? process.env.WORKSPACE - : `${REPO_ROOT}/../integration-test`; -log.info(`integrationTestRoot = ${INTEGRATION_TEST_ROOT}`); +const INTEGRATION_TEST_ROOT = process.env.WORKSPACE || resolve(REPO_ROOT, '../integration-test'); +log.info(`INTEGRATION_TEST_ROOT = ${INTEGRATION_TEST_ROOT}`); -// const stateFilePath = resolve(integrationTestRoot, '/qa/envvars.sh'); -const stateFilePath = `${INTEGRATION_TEST_ROOT}/qa/envvars.sh`; +const stateFilePath = resolve(INTEGRATION_TEST_ROOT, 'qa/envvars.sh'); log.info(`stateFilePath = ${stateFilePath}`); const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`);