Skip to content

Commit

Permalink
Normalize custom tests snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Dec 27, 2024
1 parent b15c803 commit 70e034c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion _tests/custom_tests/tests/Traits/SnapshotHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ public function assertMatchesNormalizedSnapshot( string $actual, ?\Spatie\Snapsh
$actual = preg_replace( '/qit-results-[a-z0-9]+/', 'qit-results-normalizedid', $actual );
$actual = preg_replace( '/qit-env-[a-f0-9]{32}\.json/', 'qit-env-<hash>.json', $actual );
// Remove Docker pull-related lines
// remove Docker pull-related lines
$actual = preg_replace(
'/^(?:Unable to find image .*?locally|.*Pulling fs layer.*|.*Verifying Checksum.*|.*Download complete.*|.*Pull complete.*|Digest:.*|Status: Downloaded newer image for .*?|.*: Pulling from .*|.*Waiting.*)\r?\n/m',
'/^(?:Unable to find image .*?locally'
. '|.*Pulling fs layer.*'
. '|.*Verifying Checksum.*'
. '|.*Download complete.*'
. '|.*Pull complete.*'
. '|Digest:.*'
. '|Status: Downloaded newer image for .*?'
. '|.*: Pulling from .*'
. '|\\d+(?:\\.\\d+)+:' // <-- matches a version pattern like 1.48.1.
. '|Pulling from automattic\\/qit-runner-playwright'
. '|.*Waiting.*)\r?\n/m',
'',
$actual
);
Expand Down

0 comments on commit 70e034c

Please sign in to comment.