UNPKG

e2ed

Version:

E2E testing framework over Playwright

48 lines (47 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStartInfo = void 0; const node_os_1 = require("node:os"); const configurator_1 = require("../../configurator"); const internal_1 = require("../../constants/internal"); const config_1 = require("../config"); const environment_1 = require("../environment"); const uiMode_1 = require("../uiMode"); const getPackageInfo_1 = require("./getPackageInfo"); /** * Get complete start info (CLI params, e2ed environment variables * and full e2ed configuration) on start of tests run. * @internal */ const getStartInfo = ({ configCompileTimeWithUnits }) => { const e2edEnvironmentVariables = {}; for (const name of Object.keys(internal_1.e2edEnvironment).sort()) { const value = internal_1.e2edEnvironment[name]; if (name.toUpperCase().includes('E2ED_')) { e2edEnvironmentVariables[name] = value; } } const e2ed = (0, getPackageInfo_1.getPackageInfo)('e2ed', internal_1.ABSOLUTE_PATH_TO_INSTALLED_E2ED_DIRECTORY); const totalSystemMemoryInMb = Math.round((0, node_os_1.totalmem)() / 1024 / 1024); return { absolutePathToProjectRootDirectory: internal_1.ABSOLUTE_PATH_TO_PROJECT_ROOT_DIRECTORY, availableCpuCount: (0, node_os_1.availableParallelism)(), beforePackExecutionTimeWithUnits: '', configCompileTimeWithUnits, 'cwd()': process.cwd(), e2ed, e2edEnvironmentVariables, fullPackConfig: (0, config_1.getFullPackConfig)(), installedE2edDirectoryPath: internal_1.INSTALLED_E2ED_DIRECTORY_PATH, isDebug: internal_1.IS_DEBUG, isUiMode: uiMode_1.isUiMode, nodeVersion: process.version, pathToPack: (0, environment_1.getPathToPack)(), 'process.argv': [...process.argv], pwd: internal_1.e2edEnvironment.PWD, runEnvironment: configurator_1.runEnvironment, startTimeInMs: configurator_1.startTimeInMs, totalSystemMemoryInMb, }; }; exports.getStartInfo = getStartInfo;