Skip to content

Commit f19b8a6

Browse files
authored
Improve pcov e2e tests (#6770)
1 parent a7e2b6a commit f19b8a6

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

‎.github/workflows/e2e-tests.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,20 +2036,20 @@ jobs:
20362036
../bashunit assert contains 'Bar.php:15:Call to an undefined method Ds\Pair<string, int>::copy().' "$OUTPUT"
20372037
../bashunit assert not_contains 'Ds\Seq' "$OUTPUT"
20382038
- script: |
2039-
echo "<?php echo 'Hello 1';" > test.php
2040-
XDEBUG_HANDLER_DEBUG=1 bin/phpstan analyse test.php 2>&1 | tee -a output.txt
2041-
e2e/bashunit assert file_contains output.txt "Process restarting"
2039+
cd e2e/bug-15407
2040+
XDEBUG_HANDLER_DEBUG=1 ../../bin/phpstan analyse --no-progress 2>&1 | tee -a output.txt
2041+
../bashunit assert file_contains output.txt "Process restarting"
20422042
coverage: "pcov"
20432043
- script: |
2044-
echo "<?php echo 'Hello 2';" > test.php
2045-
XDEBUG_HANDLER_DEBUG=1 bin/phpstan analyse test.php 2>&1 | tee -a output.txt
2046-
e2e/bashunit assert file_contains output.txt "Process restarting"
2044+
cd e2e/bug-15407
2045+
XDEBUG_HANDLER_DEBUG=1 ../../bin/phpstan analyse --no-progress 2>&1 | tee -a output.txt
2046+
../bashunit assert file_contains output.txt "Process restarting"
20472047
coverage: "pcov"
20482048
ini-values: "pcov.enabled=1"
20492049
- script: |
2050-
echo "<?php echo 'Hello 3';" > test.php
2051-
XDEBUG_HANDLER_DEBUG=1 bin/phpstan analyse test.php 2>&1 | tee -a output.txt
2052-
e2e/bashunit assert file_not_contains output.txt "Process restarting"
2050+
cd e2e/bug-15407
2051+
XDEBUG_HANDLER_DEBUG=1 ../../bin/phpstan analyse --no-progress 2>&1 | tee -a output.txt
2052+
../bashunit assert file_not_contains output.txt "Process restarting"
20532053
coverage: "pcov"
20542054
ini-values: "pcov.enabled=0"
20552055

‎e2e/bug-15407/pcov-check.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php declare(strict_types = 1);
2+
3+
if (extension_loaded("pcov")) {
4+
fwrite(STDERR, "pcov is still loaded after the restart\n");
5+
exit(1);
6+
}

‎e2e/bug-15407/phpstan.neon‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 0
3+
paths:
4+
- test.php
5+
bootstrapFiles:
6+
- pcov-check.php

‎e2e/bug-15407/test.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
echo 'Hello';

0 commit comments

Comments
 (0)