-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
@runClassInSeparateProcess fails for tests with a @dataProvider #2830
Comments
@KintradimCrux did you try to use |
@mihailogajic thats not the question. While writing tests for a project i found that @ runClassInSeparateProcess is not running tests without a data provider in a separate process because of missing initialization (see #2724) and also is unable to run tests with a data provider in a separate process because of an exception. I generally like the idea of running all test cases within a class in the same separate process, where @ beforeClass is run in the separate process once before starting all the tests, and @ afterClass is run in the separate process once after all tests have finished, so i'd like this annotation to work as it is supposed to. |
@KintradimCrux: Does #3082 solve your problem? @KintradimCrux and @mihailogajic: Can you provide a minimal, self-contained, reproducing test case that shows the problem that #3082 is supposed to solve? I do not understand the original example given above with all its PID "magic". |
public function inviteUserToOrganization(Organizations $organization, string $email_address)
How can I do this one |
@sebastianbergmann It's not "magic", it's setting an environment variable with the PID of the main process to see if the isolated environment runs under the same PID, which it shouldn't. To tell if #3082 fixes the problem, i need to check this first, since all i can see on Codecov is "No pull request found". |
The template in vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl.dist is creating an instance of the test class with a NULL name instead of using TestSuite for that. The result of running this test is an Exception with message "PHPUnit\Framework\TestCase::$name must not be null" when the runTest() method of the test class is called.
To detect the presence of the isolated environment, i use an autoload.php which sets an environment variable containing the main process PID, if it does not exist yet.
autoload.php:
RunClassInSeparateProcessTest.php:
The text was updated successfully, but these errors were encountered: