Fix Blocks e2e environment setup in release checks (#49379)
This commit is contained in:
parent
9fef18cd0d
commit
3ff155182e
|
@ -194,8 +194,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG: ${{ github.ref_name }}
|
RELEASE_TAG: ${{ github.ref_name }}
|
||||||
ARTIFACT_NAME: ${{ github.ref_name == 'nightly' && 'woocommerce-trunk-nightly.zip' || 'woocommerce.zip' }}
|
ARTIFACT_NAME: ${{ github.ref_name == 'nightly' && 'woocommerce-trunk-nightly.zip' || 'woocommerce.zip' }}
|
||||||
|
WP_ENV_CONFIG_PATH: ${{ matrix.projectPath }}
|
||||||
working-directory: ${{ matrix.projectPath }}
|
working-directory: ${{ matrix.projectPath }}
|
||||||
run: node ./tests/e2e-pw/bin/override-wp-env-plugins.js
|
run: node ./github/workflows/scripts/override-wp-env-plugins.js
|
||||||
|
|
||||||
- name: 'Start Test Environment'
|
- name: 'Start Test Environment'
|
||||||
id: 'prepare-test-environment'
|
id: 'prepare-test-environment'
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
/* eslint-disable no-console */
|
||||||
const fs = require( 'fs' );
|
const fs = require( 'fs' );
|
||||||
|
|
||||||
const { RELEASE_TAG, ARTIFACT_NAME } = process.env;
|
const { RELEASE_TAG, ARTIFACT_NAME, WP_ENV_CONFIG_PATH } = process.env;
|
||||||
|
|
||||||
if ( ! RELEASE_TAG ) {
|
if ( ! RELEASE_TAG ) {
|
||||||
console.error( 'Please set the RELEASE_TAG environment variable!' );
|
console.error( 'Please set the RELEASE_TAG environment variable!' );
|
||||||
|
@ -12,9 +13,12 @@ if ( ! ARTIFACT_NAME ) {
|
||||||
process.exit( 1 );
|
process.exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! WP_ENV_CONFIG_PATH ) {
|
||||||
|
console.error( 'Please set the WP_ENV_CONFIG_PATH environment variable!' );
|
||||||
|
process.exit( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
const artifactUrl = `https://github.com/woocommerce/woocommerce/releases/download/${ RELEASE_TAG }/${ ARTIFACT_NAME }`;
|
const artifactUrl = `https://github.com/woocommerce/woocommerce/releases/download/${ RELEASE_TAG }/${ ARTIFACT_NAME }`;
|
||||||
// https://github.com/woocommerce/woocommerce/releases/download/nightly/woocommerce-trunk-nightly.zip
|
|
||||||
// https://github.com/woocommerce/woocommerce/releases/download/9.0.0-beta.2/woocommerce.zip
|
|
||||||
|
|
||||||
const testEnvPlugins = {
|
const testEnvPlugins = {
|
||||||
env: {
|
env: {
|
||||||
|
@ -23,7 +27,7 @@ const testEnvPlugins = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const data = fs.readFileSync( '.wp-env.json', 'utf8' );
|
const data = fs.readFileSync( `${ WP_ENV_CONFIG_PATH }/.wp-env.json`, 'utf8' );
|
||||||
const wpEnvConfig = JSON.parse( data );
|
const wpEnvConfig = JSON.parse( data );
|
||||||
testEnvPlugins.env.tests.plugins = wpEnvConfig.env.tests.plugins;
|
testEnvPlugins.env.tests.plugins = wpEnvConfig.env.tests.plugins;
|
||||||
|
|
||||||
|
@ -34,6 +38,6 @@ if ( currentDirEntry !== -1 ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
'.wp-env.override.json',
|
`${ WP_ENV_CONFIG_PATH }/.wp-env.override.json`,
|
||||||
JSON.stringify( testEnvPlugins, null, 2 )
|
JSON.stringify( testEnvPlugins, null, 2 )
|
||||||
);
|
);
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,6 @@
|
||||||
"changes": [],
|
"changes": [],
|
||||||
"events": [
|
"events": [
|
||||||
"daily-checks",
|
"daily-checks",
|
||||||
"nightly-checks",
|
|
||||||
"release-checks"
|
"release-checks"
|
||||||
],
|
],
|
||||||
"testEnv": {
|
"testEnv": {
|
||||||
|
@ -601,7 +600,8 @@
|
||||||
"events": [
|
"events": [
|
||||||
"pull_request",
|
"pull_request",
|
||||||
"push",
|
"push",
|
||||||
"release-checks"
|
"release-checks",
|
||||||
|
"nightly-checks"
|
||||||
],
|
],
|
||||||
"report": {
|
"report": {
|
||||||
"resultsBlobName": "blocks-e2e-report",
|
"resultsBlobName": "blocks-e2e-report",
|
||||||
|
|
Loading…
Reference in New Issue