1
0
Fork 0

Add slow tests to slow group, excluded by default except for travis

pull/667/merge
Jordi Boggiano 2012-05-06 15:10:13 +02:00
parent b1eb47bdd0
commit 6967ec16b3
7 changed files with 50 additions and 13 deletions

View File

@ -9,4 +9,4 @@ before_script:
- wget -nc http://getcomposer.org/composer.phar - wget -nc http://getcomposer.org/composer.phar
- php composer.phar install - php composer.phar install
script: phpunit script: phpunit -c tests/

View File

@ -17,6 +17,12 @@
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups>
<exclude>
<group>slow</group>
</exclude>
</groups>
<filter> <filter>
<whitelist> <whitelist>
<directory>./src/Composer/</directory> <directory>./src/Composer/</directory>

View File

@ -15,9 +15,11 @@ namespace Composer\Repository;
use Composer\Repository\FilesystemRepository; use Composer\Repository\FilesystemRepository;
use Composer\Test\TestCase; use Composer\Test\TestCase;
/**
* @group slow
*/
class PearRepositoryTest extends TestCase class PearRepositoryTest extends TestCase
{ {
/** /**
* @var PearRepository * @var PearRepository
*/ */

View File

@ -17,9 +17,6 @@ use Composer\Repository\Vcs\GitHubDriver;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Config; use Composer\Config;
/**
* @author Beau Simensen <beau@dflydev.com>
*/
class GitHubDriverTest extends \PHPUnit_Framework_TestCase class GitHubDriverTest extends \PHPUnit_Framework_TestCase
{ {
public function testPrivateRepository() public function testPrivateRepository()

View File

@ -21,23 +21,26 @@ use Composer\Util\ProcessExecutor;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Config; use Composer\Config;
/**
* @group slow
*/
class VcsRepositoryTest extends \PHPUnit_Framework_TestCase class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
{ {
private static $gitRepo; private static $gitRepo;
private static $skipped; private $skipped;
public static function setUpBeforeClass() protected function initialize()
{ {
$oldCwd = getcwd(); $oldCwd = getcwd();
self::$gitRepo = sys_get_temp_dir() . '/composer-git-'.rand().'/'; self::$gitRepo = sys_get_temp_dir() . '/composer-git-'.rand().'/';
$locator = new ExecutableFinder(); $locator = new ExecutableFinder();
if (!$locator->find('git')) { if (!$locator->find('git')) {
self::$skipped = 'This test needs a git binary in the PATH to be able to run'; $this->skipped = 'This test needs a git binary in the PATH to be able to run';
return; return;
} }
if (!mkdir(self::$gitRepo) || !chdir(self::$gitRepo)) { if (!mkdir(self::$gitRepo) || !chdir(self::$gitRepo)) {
self::$skipped = 'Could not create and move into the temp git repo '.self::$gitRepo; $this->skipped = 'Could not create and move into the temp git repo '.self::$gitRepo;
return; return;
} }
@ -101,8 +104,11 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
if (self::$skipped) { if (!self::$gitRepo) {
$this->markTestSkipped(self::$skipped); $this->initialize();
}
if ($this->skipped) {
$this->markTestSkipped($this->skipped);
} }
} }

View File

@ -17,8 +17,6 @@ use Composer\Test\TestCase;
/** /**
* ErrorHandler test case * ErrorHandler test case
*
* @author Artem Lopata <biozshock@gmail.com>
*/ */
class ErrorHandlerTest extends TestCase class ErrorHandlerTest extends TestCase
{ {

28
tests/phpunit.xml.dist Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./bootstrap.php"
>
<testsuites>
<testsuite name="Full Composer Test Suite">
<directory>./Composer/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../src/Composer/</directory>
<exclude>
<file>../src/Composer/Autoload/ClassLoader.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>