diff --git a/.travis.yml b/.travis.yml index 069f1a6288..23d89b6f17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,14 @@ env: - SIMPLETEST_DB=sqlite://tmp/site.sqlite - SIMPLETEST_BASE_URL="http://127.0.0.1:8080" matrix: - - RELEASE=stable - - RELEASE=dev + - RELEASE=stable COMPOSER_CHANNEL=stable + - RELEASE=dev COMPOSER_CHANNEL=stable + - RELEASE=stable COMPOSER_CHANNEL=snapshot before_install: - echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv config-rm xdebug.ini - - composer --verbose self-update + - composer --verbose self-update --$COMPOSER_CHANNEL - composer --version install: @@ -31,6 +32,7 @@ script: - ./../vendor/bin/drush runserver http://127.0.0.1:8080 & - sleep 3 # Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json - - ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer + # Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673 + - ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,PageCache - ./../vendor/bin/drush - ./../vendor/bin/drupal diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index aa0e91ccb2..02d0f96f02 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -78,9 +78,15 @@ public static function checkComposerVersion(Event $event) { $version = $composer::VERSION; + // The dev-channel of composer uses the git revision as version number, + // try to the branch alias instead. + if (preg_match('/^[0-9a-f]{40}$/i', $version)) { + $version = $composer::BRANCH_ALIAS_VERSION; + } + // If Composer is installed through git we have no easy way to determine if // it is new enough, just display a warning. - if ($version === '@package_version@') { + if ($version === '@package_version@' || $version === '@package_branch_alias_version@') { $io->writeError('You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.'); } elseif (Comparator::lessThan($version, '1.0.0')) {