parallel-unit-test PHPUnit. Methodology of tests for parallel execution of code

parallel-unit-test

  1. Installation
  2. Create parallel test
  3. Run parallel test
  4. Code on https://github.com/petrgrishin/parallel-unit-test

Methodology of tests for parallel execution of code https://github.com/petrgrishin/parallel-unit-test

Installation

Add a dependency and script to your project's composer.json: ~~~ [javascript] {

"require": {
    "petrgrishin/parallel-unit-test": "dev-master"
},
"scripts": {
  "test:parallel": "/usr/bin/env php vendor/petrgrishin/parallel-unit-test/src/cli.php test:parallel ./home-path-for-tests"
}

} ~~~

Create parallel test

<?php
class SimpleParallelTest extends \PHPUnit_Framework_TestCase{

    /**
     * @group before
     */
    public function testInit() {
        //One run before parallel tests
    }

    /**
     * @group parallel
     */
    public function test() {
        //Will be launched in three parallel streams
        $this->assertTrue(true);
    }
}

Run parallel test

composer test:parallel

Code on https://github.com/petrgrishin/parallel-unit-test

1 0
1 follower
0 downloads
Yii Version: all
License: MIT
Category: Console
Developed by: Petr.Grishin
Created on: Mar 25, 2015
Last updated: 2 years ago

Related Extensions