-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Do not run SKIPIF
section of PHPT test in separate process when it is free of side effects
#5998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
PHPT uses a subprocess when --INI-- is present, even if --SKIPIF-- has no side-effect | ||
--INI-- | ||
error_reporting=-1 | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
if (1 == 2) { | ||
echo "skip this test\n"; | ||
} | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
echo "Hello, World!\n"; | ||
--EXPECT-- | ||
Hello, World! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--TEST-- | ||
PHPT skip condition which exits the subprocess (side-effect) | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
echo "skip this test\n"; | ||
exit(1); | ||
--EXPECT-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
The right events are emitted in the right order for a PHPT test using a subprocess via --INI-- | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/phpt-ini-subprocess.phpt'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (1 test) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (%s%ephpt-ini-subprocess.phpt, 1 test) | ||
Test Preparation Started (%s%ephpt-ini-subprocess.phpt) | ||
Test Prepared (%s%ephpt-ini-subprocess.phpt) | ||
Child Process Started | ||
Child Process Finished | ||
Child Process Started | ||
Child Process Finished | ||
Test Passed (%s%ephpt-ini-subprocess.phpt) | ||
Test Finished (%s%ephpt-ini-subprocess.phpt) | ||
Test Suite Finished (%s%ephpt-ini-subprocess.phpt, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--TEST-- | ||
The right events are emitted in the right order for a skipped PHPT test using a skipif subprocess | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/phpt-skipif-exit-subprocess.phpt'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (1 test) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (%s%ephpt-skipif-exit-subprocess.phpt, 1 test) | ||
Test Preparation Started (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Test Prepared (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Child Process Started | ||
Child Process Finished | ||
Test Skipped (%s%ephpt-skipif-exit-subprocess.phpt) | ||
is test | ||
Test Finished (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Test Suite Finished (%s%ephpt-skipif-exit-subprocess.phpt, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct like that?