[performance metrics] Use engines.pnpm version when setting up the environment (#46787)
This commit is contained in:
parent
05fed19271
commit
a33078ba6b
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Perf tests: fix environment setup issue
|
|
@ -1,3 +1,6 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
|
||||
export function median( array ) {
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
const packageJson = require( '../../package.json' );
|
||||
let pnpm_package = 'pnpm';
|
||||
|
||||
if ( packageJson.engines.pnpm ) {
|
||||
pnpm_package = `pnpm@${ packageJson.engines.pnpm }`;
|
||||
}
|
||||
|
||||
const config = {
|
||||
gitRepositoryURL: 'https://github.com/woocommerce/woocommerce.git',
|
||||
setupTestRunner:
|
||||
'npm install -g pnpm && pnpm install --filter="@woocommerce/plugin-woocommerce" &> /dev/null && cd plugins/woocommerce && pnpm exec playwright install chromium',
|
||||
setupCommand:
|
||||
'npm install -g pnpm && pnpm install &> /dev/null && pnpm build &> /dev/null',
|
||||
setupTestRunner: `npm install -g ${ pnpm_package } && pnpm install --filter="@woocommerce/plugin-woocommerce" &> /dev/null && cd plugins/woocommerce && pnpm exec playwright install chromium`,
|
||||
setupCommand: `npm install -g ${ pnpm_package } && pnpm install &> /dev/null && pnpm build &> /dev/null`,
|
||||
pluginPath: '/plugins/woocommerce',
|
||||
testsPath: '/plugins/woocommerce/tests/metrics/specs',
|
||||
testCommand:
|
||||
'npm install -g pnpm && cd plugins/woocommerce && pnpm test:metrics',
|
||||
testCommand: `npm install -g ${ pnpm_package } && cd plugins/woocommerce && pnpm test:metrics`,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
|
Loading…
Reference in New Issue