Skip to content

Commit

Permalink
[QA][Stack Integration Tests] Support defining the tests list in the …
Browse files Browse the repository at this point in the history
…Integration Test Repo (#83363)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
wayneseymour and kibanamachine committed Dec 4, 2020
1 parent fd1328f commit b6a6a30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { resolve } from 'path';
import buildState from './build_state';
import consumeState from './consume_state';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import chalk from 'chalk';
import { esTestConfig, kbnTestConfig } from '@kbn/test';
Expand All @@ -23,7 +23,7 @@ const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`);

export default async ({ readConfigFile }) => {
const xpackFunctionalConfig = await readConfigFile(require.resolve('../../functional/config'));
const { tests, ...provisionedConfigs } = buildState(resolve(__dirname, stateFilePath));
const externalConf = consumeState(resolve(__dirname, stateFilePath));
process.env.stack_functional_integration = true;
logAll(log);

Expand All @@ -40,14 +40,14 @@ export default async ({ readConfigFile }) => {
},
},
junit: {
reportName: `Stack Functional Integration Tests - ${provisionedConfigs.VM}`,
reportName: `Stack Functional Integration Tests - ${externalConf.VM}`,
},
servers: servers(),
kbnTestServer: {
...xpackFunctionalConfig.get('kbnTestServer'),
serverArgs: [...xpackFunctionalConfig.get('kbnTestServer.serverArgs')],
},
testFiles: tests.map(prepend).map(logTest),
testFiles: tests(externalConf.TESTS_LIST).map(prepend).map(logTest),
// testFiles: ['alerts'].map(prepend).map(logTest),
// If we need to do things like disable animations, we can do it in configure_start_kibana.sh, in the provisioner...which lives in the integration-test private repo
uiSettings: {},
Expand All @@ -64,6 +64,12 @@ export default async ({ readConfigFile }) => {
return settings;
};

const split = (splitter) => (x) => x.split(splitter);

function tests(externalTestsList) {
return split(' ')(externalTestsList);
}

// Returns index 1 from the resulting array-like.
const splitRight = (re) => (testPath) => re.exec(testPath)[1];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@

// eslint-disable-next-line import/no-extraneous-dependencies
import dotEnv from 'dotenv';
import testsList from './tests_list';

// envObj :: path -> {}
const envObj = (path) => dotEnv.config({ path });

// default fn :: path -> {}
export default (path) => {
const obj = envObj(path).parsed;
return { tests: testsList(obj), ...obj };
};
export default (path) => envObj(path).parsed;

0 comments on commit b6a6a30

Please sign in to comment.