Commit a8f9a9f1 authored by xjm's avatar xjm

Issue #3078671 by alexpott, Simon Peacock, greg.1.anderson, vuil, jungle,...

Issue #3078671 by alexpott, Simon Peacock, greg.1.anderson, vuil, jungle, rodrigoaguilera, sam-elayyoub, mmjvb, karolrybak, catch, longwave: Pin behat/mink and behat/mink-selenium2-driver to use resolvable release
parent dee0b484
......@@ -16,9 +16,9 @@
"wikimedia/composer-merge-plugin": "^1.4"
},
"require-dev": {
"behat/mink": "1.7.x-dev",
"behat/mink": "^1.8",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "1.3.x-dev",
"behat/mink-selenium2-driver": "^1.4",
"composer/composer": "^1.9.1",
"drupal/coder": "^8.3.2",
"jcalderonzumba/gastonjs": "^1.0.2",
......@@ -94,8 +94,7 @@
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "@composer update phpunit/phpunit symfony/phpunit-bridge phpspec/prophecy symfony/yaml --with-dependencies --no-progress",
"post-update-cmd": [
"Drupal\\Composer\\Composer::generateMetapackages",
"Drupal\\Composer\\Composer::ensureBehatDriverVersions"
"Drupal\\Composer\\Composer::generateMetapackages"
],
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c6c500e6567b37ef3e100b285ab9910c",
"content-hash": "280b46bccbba96d7e98622cac6006091",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -3536,24 +3536,26 @@
"packages-dev": [
{
"name": "behat/mink",
"version": "dev-master",
"version": "v1.8.1",
"source": {
"type": "git",
"url": "https://github.com/minkphp/Mink.git",
"reference": "a534fe7dac9525e8e10ca68e737c3d7e5058ec83"
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/a534fe7dac9525e8e10ca68e737c3d7e5058ec83",
"reference": "a534fe7dac9525e8e10ca68e737c3d7e5058ec83",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": "^2.7|^3.0|^4.0"
"symfony/css-selector": "^2.7|^3.0|^4.0|^5.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.2"
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20",
"symfony/debug": "^2.7|^3.0|^4.0",
"symfony/phpunit-bridge": "^3.4.38 || ^5.0.5"
},
"suggest": {
"behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)",
......@@ -3565,7 +3567,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev"
"dev-master": "1.8.x-dev"
}
},
"autoload": {
......@@ -3591,7 +3593,7 @@
"testing",
"web"
],
"time": "2019-07-15T12:45:29+00:00"
"time": "2020-03-11T15:45:53+00:00"
},
{
"name": "behat/mink-browserkit-driver",
......@@ -3706,16 +3708,16 @@
},
{
"name": "behat/mink-selenium2-driver",
"version": "1.3.x-dev",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/minkphp/MinkSelenium2Driver.git",
"reference": "0a09c4341621fca937a726827611b20ce3e2c259"
"reference": "312a967dd527f28980cce40850339cd5316da092"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/0a09c4341621fca937a726827611b20ce3e2c259",
"reference": "0a09c4341621fca937a726827611b20ce3e2c259",
"url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/312a967dd527f28980cce40850339cd5316da092",
"reference": "312a967dd527f28980cce40850339cd5316da092",
"shasum": ""
},
"require": {
......@@ -3729,7 +3731,7 @@
"type": "mink-driver",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
"dev-master": "1.4.x-dev"
}
},
"autoload": {
......@@ -3763,7 +3765,7 @@
"testing",
"webdriver"
],
"time": "2019-09-02T09:46:54+00:00"
"time": "2020-03-11T14:43:21+00:00"
},
{
"name": "composer/ca-bundle",
......@@ -6379,9 +6381,7 @@
"stability-flags": {
"drupal/core": 20,
"drupal/core-project-message": 20,
"drupal/core-vendor-hardening": 20,
"behat/mink": 20,
"behat/mink-selenium2-driver": 20
"drupal/core-vendor-hardening": 20
},
"prefer-stable": true,
"prefer-lowest": false,
......
......@@ -6,7 +6,6 @@
use Composer\Script\Event;
use Composer\Semver\Comparator;
use Drupal\Composer\Generator\PackageGenerator;
use Drupal\Composer\Generator\Util\DrupalCoreComposer;
/**
* Provides static functions for composer script events. See also
......@@ -40,34 +39,6 @@ public static function ensureComposerVersion() {
}
}
/**
* Ensure that the right version of behat/mink-selenium2-driver is locked.
* Throw an exception if we do not have 1.3.x-dev.
*
* @todo: Remove this once https://www.drupal.org/node/3078671 is fixed.
*/
public static function ensureBehatDriverVersions() {
$drupalCoreComposer = DrupalCoreComposer::createFromPath(getcwd());
$expectedVersion = '1.3.x-dev';
$behatMinkSelenium2DriverInfo = $drupalCoreComposer->packageLockInfo('behat/mink-selenium2-driver', TRUE);
if ($behatMinkSelenium2DriverInfo['version'] != $expectedVersion) {
$drupalVersion = static::drupalVersionBranch();
$message = <<< __EOT__
Drupal requires behat/mink-selenium2-driver:$expectedVersion in its composer.json
file, but it is pinned to {$behatMinkSelenium2DriverInfo['version']} in the composer.lock file.
This sometimes happens when Composer becomes confused. To fix:
1. `git checkout -- composer.lock`, or otherwise reset to a known-good lock file.
2. `rm -rf vendor`
3. `composer install`
4. `COMPOSER_ROOT_VERSION={$drupalVersion} composer update ...` (where ... is
the update arguments you wish to run, e.g. --lock).
__EOT__;
throw new \RuntimeException($message);
}
}
/**
* Return the branch name the current Drupal version is associated with.
*
......
......@@ -24,18 +24,6 @@ public function getPackage() {
// Put everything from Drupal's "require-dev" into our "require" section.
$composer['require'] = $this->drupalCoreInfo->getRequireDev();
// If the require-dev is bringing in a dev version of behat/mink, convert
// the requirement to a more flexible set of versions.
// @todo: remove when https://www.drupal.org/node/3078671 is fixed.
if (isset($composer['require']['behat/mink']) && ($composer['require']['behat/mink'] == '1.7.x-dev')) {
$composer['require']['behat/mink'] = '1.8.0 | 1.7.1.1 | 1.7.x-dev';
}
// Do the same sort of conversion for behat/mink-selenium2-driver.
if (isset($composer['require']['behat/mink-selenium2-driver']) && ($composer['require']['behat/mink-selenium2-driver'] == '1.3.x-dev')) {
$composer['require']['behat/mink-selenium2-driver'] = '1.4.0 | 1.3.1.1 | 1.3.x-dev';
}
// Sort our required packages by key.
ksort($composer['require']);
......
......@@ -28,21 +28,8 @@ public function getPackage() {
$composerLockData = $this->drupalCoreInfo->composerLock();
if (isset($composerLockData['packages-dev'])) {
foreach ($composerLockData['packages-dev'] as $package) {
$composer['require'][$package['name']] = $package['version'];
// If the require-dev is bringing in a dev version of behat/mink,
// convert the requirement to a more flexible set of versions.
// @todo: remove when https://www.drupal.org/node/3078671 is fixed.
if (($package['name'] == 'behat/mink') && (($package['version'] == 'dev-master') || ($package['version'] == '1.7.x-dev'))) {
$composer['require']['behat/mink'] = '1.8.0 | 1.7.1.1 | 1.7.x-dev';
}
// Do the same sort of conversion for behat/mink-selenium2-driver.
if (($package['name'] == 'behat/mink-selenium2-driver') && (($package['version'] == 'dev-master') || ($package['version'] == '1.3.x-dev'))) {
$composer['require']['behat/mink-selenium2-driver'] = '1.4.0 | 1.3.1.1 | 1.3.x-dev';
}
}
}
return $composer;
......
......@@ -7,9 +7,9 @@
"webflo/drupal-core-require-dev": "*"
},
"require": {
"behat/mink": "1.8.0 | 1.7.1.1 | 1.7.x-dev",
"behat/mink": "^1.8",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "1.4.0 | 1.3.1.1 | 1.3.x-dev",
"behat/mink-selenium2-driver": "^1.4",
"composer/composer": "^1.9.1",
"drupal/coder": "^8.3.2",
"jcalderonzumba/gastonjs": "^1.0.2",
......
......@@ -8,10 +8,10 @@
},
"require": {
"drupal/core": "8.8.x-dev",
"behat/mink": "1.8.0 | 1.7.1.1 | 1.7.x-dev",
"behat/mink": "v1.8.1",
"behat/mink-browserkit-driver": "1.3.3",
"behat/mink-goutte-driver": "v1.2.1",
"behat/mink-selenium2-driver": "1.4.0 | 1.3.1.1 | 1.3.x-dev",
"behat/mink-selenium2-driver": "v1.4.0",
"composer/ca-bundle": "1.2.4",
"composer/composer": "1.9.1",
"composer/spdx-licenses": "1.5.2",
......
......@@ -25,23 +25,4 @@ public function testEnsureComposerVersion() {
}
}
/**
* Verify that Composer::ensureBehatDriverVersions() detects a good version.
*
* @covers::ensureBehatDriverVersions
*/
public function testEnsureBehatDriverVersions() {
// First call 'ensureBehatDriverVersions' test directly using Drupal's
// composer.lock. It should not fail.
chdir($this->root);
$this->assertNull(Composer::ensureBehatDriverVersions());
// Next, call 'ensureBehatDriverVersions' again, this time using a fixture
// with a known-bad version number.
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessageRegExp('#^Drupal requires behat/mink-selenium2-driver:1.3.x-dev#');
chdir(__DIR__ . '/fixtures/ensureBehatDriverVersionsFixture');
$this->assertNull(Composer::ensureBehatDriverVersions());
}
}
......@@ -49,7 +49,7 @@ public function builderTestData() {
'license' => 'GPL-2.0-or-later',
'require' =>
[
'behat/mink' => '1.8.0 | 1.7.1.1 | 1.7.x-dev',
'behat/mink' => '^1.8',
],
'conflict' =>
[
......@@ -68,7 +68,7 @@ public function builderTestData() {
'require' =>
[
'drupal/core' => Composer::drupalVersionBranch(),
'behat/mink' => '1.8.0 | 1.7.1.1 | 1.7.x-dev',
'behat/mink' => 'v1.8.0',
'symfony/css-selector' => 'v4.3.5',
],
'conflict' =>
......
......@@ -38,7 +38,7 @@ protected function composerJson() {
],
'require-dev' =>
[
'behat/mink' => '1.7.x-dev',
'behat/mink' => '^1.8',
],
];
}
......@@ -84,12 +84,12 @@ protected function composerLock() {
[
[
'name' => 'behat/mink',
'version' => 'dev-master',
'version' => 'v1.8.0',
'source' =>
[
'type' => 'git',
'url' => 'https://github.com/minkphp/Mink.git',
'reference' => 'a534fe7dac9525e8e10ca68e737c3d7e5058ec83',
'reference' => 'e1772aabb6b654464264a6cc72158c8b3409d8bc',
],
],
[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment