Skip to content

Commit

Permalink
Merge pull request #217 from woocommerce/24-10/env-vars
Browse files Browse the repository at this point in the history
Custom Tests: Allow to pass env vars
  • Loading branch information
Luc45 authored Oct 30, 2024
2 parents c4cf121 + 295e711 commit 08c3934
Show file tree
Hide file tree
Showing 33 changed files with 518 additions and 360 deletions.
2 changes: 1 addition & 1 deletion _tests/custom_tests/tests/RunE2ETest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function test_run_with_snapshot() {
if ( $return_var === 0 ) {
// Modify the image using ImageMagick's convert command
$image_path = $scaffolded_dir . '/__snapshots__/activate-theme.spec.js/home.png';
exec( "magick convert $image_path -gravity southeast -stroke '#000C' -strokewidth 2 -annotate 0 'Watermark' -stroke none -fill white -annotate 0 'Watermark' $image_path" );
exec( "magick $image_path -gravity southeast -stroke '#000C' -strokewidth 2 -annotate 0 'Watermark' -stroke none -fill white -annotate 0 'Watermark' $image_path" );

// Run the third time to check for snapshot failure.
$output = qit( [
Expand Down
5 changes: 5 additions & 0 deletions _tests/custom_tests/tests/Traits/SnapshotHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public function assertMatchesNormalizedSnapshot( string $actual, ?\Spatie\Snapsh
continue;
}

// Skip empty lines.
if ( trim( $line ) === '' ) {
continue;
}

/*
* Skip docker pull output.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-multiple-test-tags/bootstrap/bootstrap.php
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-multiple-test-tags/bootstrap/bootstrap.sh
Expand All @@ -30,12 +29,7 @@ Running 7 tests using 1 worker
7 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/local/bootstrap/bootstrap.php
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/local/bootstrap/bootstrap.sh
Expand All @@ -14,12 +13,7 @@ Running 1 test using 1 worker
1 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-bootstrap-additional/bootstrap/bootstrap.php
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-bootstrap-additional/bootstrap/bootstrap.sh
Expand All @@ -17,12 +16,7 @@ Running 1 test using 1 worker
1 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-sut-and-test-additional/bootstrap/bootstrap.php
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/self-test-sut-and-test-additional/bootstrap/bootstrap.sh
Expand All @@ -20,12 +19,7 @@ Running 3 tests using 1 worker
3 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...

[OK] Temporary test environment created. (ENV_ID)

* URL: http://localhost:PORT
* Admin URL: http://localhost:PORT/wp-admin
* Admin Credentials: admin/password
* PHP Version: 7.4
* WordPress Version: NORMALIZED
* Redis Object Cache? No
* Path: QIT_HOME/temporary-envs/e2e-ENV_ID/

To see additional info, run with the "--verbose" flag.

http://localhost:PORT

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gd

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Field Value
name Storefront
status inactive

Field Value
name Twenty Seventeen
status inactive

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ author
version 1.0
description A temporary plugin for testing.
status active

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Success: Plugin already updated.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Success: Plugin already updated.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce /qit/tests/e2e/woocommerce/default/bootstrap/bootstrap.sh
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/local/bootstrap/bootstrap.php
Expand All @@ -15,12 +14,7 @@ Running 1 test using 1 worker
1 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Both "--woo" and "--plugin woocommerce" cannot be used at the same time. Please use one or another when running the test.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/self-test-multiple-test-tags/bootstrap/bootstrap.php
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/self-test-multiple-test-tags/bootstrap/bootstrap.sh
Expand All @@ -20,12 +19,7 @@ Running 3 tests using 1 worker
3 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Loading environment config from override parameter /tmp-normalized/qit-env-<hash>.json...
Warning: Key "config" not found in environment info.
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/local/bootstrap/bootstrap.php
Bootstrapping woocommerce-amazon-s3-storage /qit/tests/e2e/woocommerce-amazon-s3-storage/local/bootstrap/bootstrap.sh
Expand All @@ -18,12 +17,7 @@ Consider splitting slow test files to speed up parallel execution
1 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping deli /qit/tests/e2e/deli/local/bootstrap/bootstrap.php
Bootstrapping deli /qit/tests/e2e/deli/local/bootstrap/bootstrap.sh
Expand Down Expand Up @@ -56,12 +55,7 @@ path: '/qit/results/playwright/activate-theme-I-can-activate-Deli-deli-local/hom
2 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Downloading plugins and themes...
Setting up Docker...
Setting up WordPress...
Starting Docker Environment...
Installing WordPress...
Activating plugins...
Environment ready.

Bootstrapping Plugins
Bootstrapping deli /qit/tests/e2e/deli/local/bootstrap/bootstrap.php
Bootstrapping deli /qit/tests/e2e/deli/local/bootstrap/bootstrap.sh
Expand All @@ -15,12 +14,7 @@ Running 2 tests using 1 worker
2 passed (TIME)
Test artifacts being saved to: /tmp-normalized/qit-results-normalizedid
Uploading zip...


 
 [OK] Tests passed. Run 'qit e2e-report' to view the report. 
 


Shutting down environment...

Loading

0 comments on commit 08c3934

Please sign in to comment.