Skip to content

Run a class in separate process. #2591

@ArturGoldyn

Description

@ArturGoldyn
Contributor
Q A
PHPUnit version 4.0.2
PHP version 5.3.3
Installation Method PHAR

We can run individual tests in separate processes, but we cannot run a test class in a separate process.
It would be nice to have @runTestsClassInSeparateProcess, not only @runTestsInSeparateProcesses

The goal is to run setUpBeforeClass once (it takes a few seconds), then perform all tests in separate process, and then at the end lose all global variable changes that occured.
Unfortunately some of our objects collide and don't allow us to pass to the next test, but they work with --process-isolation parameter perfectly. Therefore we would like to have a @runTestsClassInSeparateProcess annotation to run just few classes in separate process, but use this one process for all tests in this class.

Activity

ArturGoldyn

ArturGoldyn commented on Apr 24, 2017

@ArturGoldyn
ContributorAuthor

I've started working on it yesterday, will finish this week.

ArturGoldyn

ArturGoldyn commented on Apr 29, 2017

@ArturGoldyn
ContributorAuthor

For now it fails in AppVeyor. #2664

ArturGoldyn

ArturGoldyn commented on May 9, 2017

@ArturGoldyn
ContributorAuthor

@sebastianbergmann I did it, and fixed that failing merge request, do you consider merging my branch to some release? Or does it need any alterations?

added 3 commits that reference this issue on Jun 1, 2017
added this to the PHPUnit 6.2 milestone on Jun 1, 2017
kaphert

kaphert commented on Oct 11, 2017

@kaphert

Am I correct that this feature is implemented since 6.2 but is missing in the documentation?

Search in repository on runClassInSeparateProcess https://github.com/sebastianbergmann/phpunit/search?q=runClassInSeparateProcess&type=Code&utf8=%E2%9C%93

added 2 commits that reference this issue on Oct 18, 2017

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type/enhancementA new idea that should be implemented

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sebastianbergmann@kaphert@ArturGoldyn@WalterWoshid

      Issue actions

        Run a class in separate process. · Issue #2591 · sebastianbergmann/phpunit