Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
parallel test using ant
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 2, 2014
1 parent 4e5b1e6 commit b5d4261
Show file tree
Hide file tree
Showing 9 changed files with 68,308 additions and 16 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
service_name: travis-ci
src_dir: module
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ public/js/dependencies/
public/css/.sass-cache/
/nbproject
build/

8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ install:
- composer install --dev --prefer-source

before_script:
- mkdir -p build/coverage
- mkdir -p build/logs

script:
- ls -d module/* | parallel --gnu --keep-order 'echo "Running {} CS checks"; ./vendor/bin/php-cs-fixer fix {} -v --dry-run --config-file=.php_cs;' || exit 1
- phpunit --coverage-clover build/logs/clover.xml

- ant
after_script:
- php phpcov.phar merge --clover build/logs/clover.xml build/coverage/
- php vendor/bin/coveralls -v

notifications:
Expand Down
19 changes: 19 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="learnzf2" default="phpunit">
<target name="phpunit">
<parallel threadCount="2">
<echo message="Running tests" />

<exec executable="phpunit" failonerror="true">
<arg line="-c ${basedir}/module/Application/test/phpunit.xml" />
<arg line="--coverage-php build/coverage/coverage-application.cov" />
</exec>

<exec executable="phpunit" failonerror="true">
<arg line="-c ${basedir}/module/LearnZF2FormUsage/test/phpunit.xml" />
<arg line="--coverage-php build/coverage/coverage-learnzf2formusage.cov" />
</exec>

</parallel>
</target>
</project>
6 changes: 2 additions & 4 deletions Bootstrap.php → module/LearnZF2FormUsage/test/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use RuntimeException;

error_reporting(E_ALL | E_STRICT);

chdir(__DIR__);

/**
* Test bootstrap, for setting up autoloading
Expand All @@ -35,9 +35,7 @@ public static function init()
'module_paths' => $zf2ModulePaths,
),
'modules' => array(
'Application',
'LearnZF2Ajax',
'LearnZF2FormUsage',
'LearnZF2FormUsage'
)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace LearnZF2FormUsageTest\Controller;

use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;

class IndexControllerTest extends AbstractHttpControllerTestCase
{
public function setUp()
{
$this->setApplicationConfig(
include dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/config/application.config.php'
);
parent::setUp();
}

public function testIndexActionCanBeAccessed()
{
$this->dispatch('/learn-zf2-form-usage');
$this->assertResponseStatusCode(200);

$this->assertModuleName('LearnZF2FormUsage');
$this->assertControllerName('LearnZF2FormUsage\Controller\Form');
$this->assertControllerClass('FormController');
$this->assertMatchedRouteName('learn-zf2-form-usage');
}
}
5 changes: 5 additions & 0 deletions module/LearnZF2FormUsage/test/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<phpunit bootstrap="Bootstrap.php" colors="true">
<testsuite name="LearnZF2FormUsage" >
<directory>./LearnZF2FormUsageTest</directory>
</testsuite>
</phpunit>
68,250 changes: 68,250 additions & 0 deletions phpcov.phar

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions phpunit.xml

This file was deleted.

0 comments on commit b5d4261

Please sign in to comment.