Update @wordpress/env to 8.1.1 and re-enable PHP Unit Tests for PHP v 8.1 and 8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9875)
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com> Co-authored-by: Alexandre Lara <allexandrelara@gmail.com> Co-authored-by: Luigi Teschio <gigitux@gmail.com> Co-authored-by: Alba Rincón <alba.rincon@automattic.com> Co-authored-by: Alba Rincón <albarin@users.noreply.github.com> Co-authored-by: Tung Du <dinhtungdu@gmail.com>
This commit is contained in:
parent
70aa569254
commit
ac7e115c3e
|
@ -80,8 +80,6 @@ jobs:
|
|||
##
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
with:
|
||||
php-version: '${{ matrix.php }}'
|
||||
ini-file: development
|
||||
|
@ -89,29 +87,21 @@ jobs:
|
|||
|
||||
# Ensure that Composer installs the correct versions of packages.
|
||||
- name: Override PHP version in composer.json
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: |
|
||||
composer config platform.php ${{ matrix.php }}
|
||||
composer update
|
||||
|
||||
- name: Install npm dependencies
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Docker debug information
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: |
|
||||
docker -v
|
||||
docker-compose -v
|
||||
|
||||
- name: General debug information
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: |
|
||||
npm --version
|
||||
node --version
|
||||
|
@ -121,26 +111,18 @@ jobs:
|
|||
locale -a
|
||||
|
||||
- name: Start Docker environment
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: npm run wp-env start --update
|
||||
|
||||
- name: Log running Docker containers
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: docker ps -a
|
||||
|
||||
- name: Docker container debug information
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: |
|
||||
npm run wp-env run tests-mysql mysql -- --version
|
||||
npm run wp-env run tests-wordpress "php --version"
|
||||
npm run wp-env run tests-wordpress "php -m"
|
||||
npm run wp-env run tests-wordpress "php -i"
|
||||
npm run wp-env run tests-wordpress "locale -a"
|
||||
npm run wp-env run tests-wordpress php -- --version
|
||||
npm run wp-env run tests-wordpress php -- -m
|
||||
npm run wp-env run tests-wordpress php -- -i
|
||||
npm run wp-env run tests-wordpress locale -- -a
|
||||
|
||||
- name: Run PHPUnit tests
|
||||
# 8.1 and 8.2 are temporarily disabled as docker-images for those cause the errors when pipeline is running
|
||||
if: ${{ matrix.php == '7.4' || matrix.php == '8.0' }}
|
||||
run: npm run test:php
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -94,7 +94,7 @@
|
|||
"env:stop": "npm run wp-env stop",
|
||||
"test:help": "wp-scripts test-unit-js --help",
|
||||
"test:performance": "npm run wp-env:config && cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.performance.config.js -- performance",
|
||||
"test:php": "wp-env run --env-cwd='wp-content/plugins/${PWD##*/}' tests-wordpress vendor/bin/phpunit -c phpunit.xml.dist",
|
||||
"test:php": "wp-env run --env-cwd=\"wp-content/plugins/${PWD##*/}\" tests-wordpress vendor/bin/phpunit -- -c phpunit.xml.dist",
|
||||
"test:update": "wp-scripts test-unit-js --updateSnapshot --config tests/js/jest.config.json",
|
||||
"test:watch": "npm run test -- --watch",
|
||||
"ts:check": "tsc --build",
|
||||
|
@ -171,7 +171,7 @@
|
|||
"@wordpress/e2e-test-utils-playwright": "0.6.0",
|
||||
"@wordpress/e2e-tests": "^4.6.0",
|
||||
"@wordpress/element": "4.20.0",
|
||||
"@wordpress/env": "7.0.0",
|
||||
"@wordpress/env": "8.1.1",
|
||||
"@wordpress/html-entities": "3.24.0",
|
||||
"@wordpress/i18n": "4.24.0",
|
||||
"@wordpress/is-shallow-equal": "4.24.0",
|
||||
|
|
|
@ -7,4 +7,4 @@ head_dir=$(cd "$(dirname "$script_dir")" && cd ../../.. && pwd)
|
|||
relative_path=${script_dir#$head_dir/}
|
||||
|
||||
# Run the main script in the container for better performance.
|
||||
wp-env run tests-cli "bash wp-content/plugins/$relative_path/scripts/index.sh"
|
||||
wp-env run tests-cli -- bash wp-content/plugins/$relative_path/scripts/index.sh
|
||||
|
|
|
@ -10,7 +10,7 @@ import { test as setup, expect } from '@woocommerce/e2e-playwright-utils';
|
|||
|
||||
setup( 'Sets up the block theme', async ( { admin } ) => {
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli "wp theme install ${ BLOCK_THEME_SLUG } --activate"`
|
||||
`npm run wp-env run tests-cli -- wp theme install ${ BLOCK_THEME_SLUG } --activate`
|
||||
);
|
||||
await admin.page.goto( '/wp-admin/themes.php' );
|
||||
await expect(
|
||||
|
|
|
@ -10,7 +10,7 @@ import { test as setup, expect } from '@woocommerce/e2e-playwright-utils';
|
|||
|
||||
setup( 'Sets up the classic theme', async ( { admin } ) => {
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli "wp theme install ${ CLASSIC_THEME_SLUG } --activate"`
|
||||
`npm run wp-env run tests-cli -- wp theme install ${ CLASSIC_THEME_SLUG } --activate`
|
||||
);
|
||||
await admin.page.goto( '/wp-admin/themes.php' );
|
||||
await expect(
|
||||
|
|
|
@ -119,11 +119,11 @@ const prepareAttributes = async ( config: FullConfig ) => {
|
|||
* we need to process more than 1 batch of items.
|
||||
*/
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli wp action-scheduler run --hooks="woocommerce_run_product_attribute_lookup_regeneration_callback"`
|
||||
`npm run wp-env run tests-cli -- wp action-scheduler run --hooks="woocommerce_run_product_attribute_lookup_regeneration_callback"`
|
||||
);
|
||||
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli wp action-scheduler run --hooks="woocommerce_run_product_attribute_lookup_regeneration_callback"`
|
||||
`npm run wp-env run tests-cli -- wp action-scheduler run --hooks="woocommerce_run_product_attribute_lookup_regeneration_callback"`
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -18,14 +18,14 @@ export const installPluginFromPHPFile = async ( phpFilePath: string ) => {
|
|||
await createPluginFromPHPFile( phpFilePath );
|
||||
const fileName = path.basename( phpFilePath ).replace( '.php', '' );
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli "wp plugin install /var/www/html/custom-plugins/${ fileName }.zip --activate"`
|
||||
`npm run wp-env run tests-cli -- wp plugin install /var/www/html/custom-plugins/${ fileName }.zip --activate`
|
||||
);
|
||||
};
|
||||
|
||||
export const uninstallPluginFromPHPFile = async ( phpFilePath: string ) => {
|
||||
const fileName = path.basename( phpFilePath ).replace( '.php', '' );
|
||||
await cli(
|
||||
`npm run wp-env run tests-cli "wp plugin delete ${ fileName }"`
|
||||
`npm run wp-env run tests-cli -- wp plugin delete ${ fileName }`
|
||||
);
|
||||
await cli( `rm ${ __dirname }/${ fileName }.zip` );
|
||||
};
|
||||
|
|
|
@ -51,14 +51,14 @@ const templates = {
|
|||
|
||||
test.beforeAll( async () => {
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option update wc_blocks_use_blockified_product_grid_block_as_template false"'
|
||||
'npm run wp-env run tests-cli -- wp option update wc_blocks_use_blockified_product_grid_block_as_template false'
|
||||
);
|
||||
await deleteAllTemplates( 'wp_template' );
|
||||
} );
|
||||
|
||||
test.afterAll( async () => {
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option delete wc_blocks_use_blockified_product_grid_block_as_template"'
|
||||
'npm run wp-env run tests-cli -- wp option delete wc_blocks_use_blockified_product_grid_block_as_template'
|
||||
);
|
||||
await deleteAllTemplates( 'wp_template' );
|
||||
} );
|
||||
|
|
|
@ -9,10 +9,10 @@ test.describe(
|
|||
async () => {
|
||||
test.afterAll( async () => {
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option update woocommerce_cart_page_endpoint cart"'
|
||||
'npm run wp-env run tests-cli -- wp option update woocommerce_cart_page_endpoint cart'
|
||||
);
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option update woocommerce_checkout_page_endpoint checkout"'
|
||||
'npm run wp-env run tests-cli -- wp option update woocommerce_checkout_page_endpoint checkout'
|
||||
);
|
||||
} );
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ test.describe( `${ blockData.name } Block - with All products Block`, () => {
|
|||
test.describe( `${ blockData.name } Block - with PHP classic template`, () => {
|
||||
test.beforeAll( async () => {
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option update wc_blocks_use_blockified_product_grid_block_as_template false"'
|
||||
'npm run wp-env run tests-cli -- wp option update wc_blocks_use_blockified_product_grid_block_as_template false'
|
||||
);
|
||||
} );
|
||||
test.beforeEach( async ( { admin, page, editor } ) => {
|
||||
|
@ -172,7 +172,7 @@ test.describe( `${ blockData.name } Block - with PHP classic template`, () => {
|
|||
|
||||
test.afterAll( async () => {
|
||||
await cli(
|
||||
'npm run wp-env run tests-cli "wp option delete wc_blocks_use_blockified_product_grid_block_as_template"'
|
||||
'npm run wp-env run tests-cli -- wp option delete wc_blocks_use_blockified_product_grid_block_as_template'
|
||||
);
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue