Skip to content

Commit

Permalink
Add coveralls support and fix a few testing bugs related to coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed May 3, 2013
1 parent dd12afa commit da42c0d
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ before_install:
script:
- ant travis -keep-going

after_script:
- php vendor/bin/coveralls

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
### Welcome to the *Zend Framework 2.2* Release!

Master: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2)
Develop: [![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2)
Master:
[![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=master)](http://travis-ci.org/zendframework/zf2)
[![Coverage Status](https://coveralls.io/repos/zendframework/zf2/badge.png?branch=master)](https://coveralls.io/r/zendframework/zf2)
Develop:
[![Build Status](https://secure.travis-ci.org/zendframework/zf2.png?branch=develop)](http://travis-ci.org/zendframework/zf2)
[![Coverage Status](https://coveralls.io/repos/zendframework/zf2/badge.png?branch=develop)](https://coveralls.io/r/zendframework/zf2)

## RELEASE INFORMATION

Expand Down
19 changes: 18 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZF2" default="build">
<target name="travis" depends="tests-parallel,show-test-results" />
<target name="travis" depends="tests-parallel,merge-clover,show-test-results" />

<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build"/>
Expand All @@ -9,6 +9,8 @@
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/test-results"/>
<mkdir dir="${basedir}/build/cs-results"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
</target>

<target name="get-cs-fixer" depends="clean" description="Get coding standards fixer">
Expand All @@ -31,6 +33,19 @@
</sequential>
</target>

<target name="merge-clover" description="Merges the individual clover reports of each component into a single clover.xml">
<sequential>
<exec executable="vendor/bin/phpcov.php" failonerror="true">
<arg value="--merge" />
<arg value="--clover" />
<arg value="${basedir}/build/logs/clover.xml" />
<arg value="--whitelist" />
<arg value="${basedir}/library" />
<arg value="${basedir}/build/coverage" />
</exec>
</sequential>
</target>

<target
name="tests-parallel"
depends="prepare,composer-install,get-cs-fixer"
Expand Down Expand Up @@ -118,6 +133,8 @@
>
<arg value="-c" />
<arg value="${basedir}/tests/phpunit.xml.dist" />
<arg value="--coverage-php" />
<arg value="${basedir}/build/coverage/coverage-@{component}.cov" />
<arg value="${basedir}/tests/ZendTest/@{component}" />
</exec>
</sequential>
Expand Down
25 changes: 24 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"repositories": [
{
"type": "package",
"package": {
"name": "sebastianbergmann/phpcov",
"version": "1.1.0",
"dist": {
"url": "https://github.com/sebastianbergmann/phpcov/archive/1.1.0.zip",
"type": "zip"
},
"source": {
"url": "https://github.com/sebastianbergmann/phpcov.git",
"type": "git",
"reference": "1.1.0"
},
"bin": [
"phpcov.php"
]
}
}
],
"require": {
"php": ">=5.3.3"
},
Expand All @@ -16,7 +37,9 @@
"ircmaxell/random-lib": "dev-master",
"ircmaxell/security-lib": "dev-master",
"ocramius/proxy-manager": "0.3.*",
"phpunit/PHPUnit": "3.7.*"
"phpunit/PHPUnit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
"sebastianbergmann/phpcov": "1.1.0"
},
"suggest": {
"ext-intl": "ext/intl for i18n features (included in default builds of PHP)",
Expand Down
6 changes: 3 additions & 3 deletions tests/ZendTest/Http/Header/AcceptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function testWildcardWithDifferentParamsAndRanges()

/**
* @group 3739
* @covers Accept::matchAcceptParams()
* @covers Zend\Http\Header\AbstractAccept::matchAcceptParams()
*/
public function testParamRangesWithDecimals()
{
Expand All @@ -293,8 +293,8 @@ public function testParamRangesWithDecimals()
/**
* @group 3740
* @dataProvider provideParamRanges
* @covers Accept::matchAcceptParams()
* @covers Accept::getParametersFromFieldValuePart()
* @covers Zend\Http\Header\AbstractAccept::matchAcceptParams()
* @covers Zend\Http\Header\AbstractAccept::getParametersFromFieldValuePart()
*/
public function testParamRangesSupportDevStage($range, $input, $success)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/ZendTest/Mvc/Controller/ControllerManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function testInjectControllerDependenciesWillNotOverwriteExistingEventMan
}

/**
* @covers ControllerManager::has
* @covers ControllerManager::get
* @covers Zend\ServiceManager\ServiceManager::has
* @covers Zend\ServiceManager\AbstractPluginManager::get
*/
public function testDoNotUsePeeringServiceManagers()
{
Expand Down
5 changes: 5 additions & 0 deletions tests/ZendTest/Validator/File/IsCompressedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ protected function getMagicMime()
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

// Ubuntu has backported the changes in 12.04 to PHP 5.3.10.
if (strpos(PHP_VERSION, 'ubuntu') !== false && version_compare(PHP_VERSION, '5.3.10', '>=')) {
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

return __DIR__ . '/_files/magic.mime';
}

Expand Down
5 changes: 5 additions & 0 deletions tests/ZendTest/Validator/File/IsImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ protected function getMagicMime()
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

// Ubuntu has backported the changes in 12.04 to PHP 5.3.10.
if (strpos(PHP_VERSION, 'ubuntu') !== false && version_compare(PHP_VERSION, '5.3.10', '>=')) {
return __DIR__ . '/_files/magic.lte.5.3.10.mime';
}

return __DIR__ . '/_files/magic.mime';
}

Expand Down

0 comments on commit da42c0d

Please sign in to comment.