diff --git a/.travis.yml b/.travis.yml index a751e658e..4a32fe295 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: php sudo: false + dist: trusty +git: + depth: 5 + cache: directories: - $HOME/.composer/cache @@ -29,16 +33,27 @@ matrix: allow_failures: - php: nightly -before_script: - - rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - - flags="--prefer-dist" +before_install: + # determine INI file + - if [[ $TRAVIS_PHP_VERSION = hhvm* ]]; then export INI=/etc/hhvm/php.ini; else export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi + # disable xdebug if available + - phpenv config-rm xdebug.ini || echo "xdebug not available" + # disable default memory limit + - echo memory_limit = -1 >> $INI + +install: + # flags to pass to install + - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress" + # install dependencies using system provided composer binary - composer install $flags + # install dependencies using composer from source - bin/composer install $flags + +before_script: + # make sure git tests do not complain about user/email not being set - git config --global user.name travis-ci - git config --global user.email travis@example.com script: + # run test suite directories in parallel using GNU parallel - ls -d tests/Composer/Test/* | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && $(exit 1));' - -git: - depth: 5 diff --git a/src/Composer/Repository/Vcs/HgDriver.php b/src/Composer/Repository/Vcs/HgDriver.php index cf256fa1d..bf7c91552 100644 --- a/src/Composer/Repository/Vcs/HgDriver.php +++ b/src/Composer/Repository/Vcs/HgDriver.php @@ -118,7 +118,7 @@ class HgDriver extends VcsDriver public function getFileContent($file, $identifier) { $resource = sprintf('hg cat -r %s %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file)); - $this->process->execute(sprintf('hg cat -r %s', $resource), $content, $this->repoDir); + $this->process->execute($resource, $content, $this->repoDir); if (!trim($content)) { return; diff --git a/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index c379438a9..4c6757489 100644 --- a/tests/Composer/Test/CacheTest.php +++ b/tests/Composer/Test/CacheTest.php @@ -24,10 +24,6 @@ class CacheTest extends TestCase public function setUp() { - if (getenv('TRAVIS')) { - $this->markTestSkipped('Test causes intermittent failures on Travis'); - } - $this->root = $this->getUniqueTmpDirectory(); $this->files = array(); $zeros = str_repeat('0', 1000); diff --git a/tests/Composer/Test/Fixtures/functional/create-project-command.test b/tests/Composer/Test/Fixtures/functional/create-project-command.test index 35c343355..1c4813446 100644 --- a/tests/Composer/Test/Fixtures/functional/create-project-command.test +++ b/tests/Composer/Test/Fixtures/functional/create-project-command.test @@ -1,11 +1,4 @@ --RUN-- create-project seld/jsonlint %testDir% 1.0.0 --prefer-source -n ---EXPECT-ERROR-- -Installing seld/jsonlint (1.0.0) - - Installing seld/jsonlint (1.0.0): Cloning 3b4bc2a96f -Created project in %testDir% -Loading composer repositories with package information -Updating dependencies (including require-dev) -Nothing to install or update -Writing lock file -Generating autoload files +--EXPECT-ERROR-REGEX-- +{Installing seld/jsonlint \(1.0.0\): Cloning [a-f0-9]{10}( from cache)?} diff --git a/tests/Composer/TestCase.php b/tests/Composer/TestCase.php index 1d1784600..b827ffa90 100644 --- a/tests/Composer/TestCase.php +++ b/tests/Composer/TestCase.php @@ -91,7 +91,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase * * @param string $executableName The name of the binary to test. * - * @throws PHPUnit_Framework_SkippedTestError + * @throws \PHPUnit_Framework_SkippedTestError */ protected function skipIfNotExecutable($executableName) {