Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for behat/mink-extension in favor of friends-of-behat/mink-extension #78

Open
robertfausk opened this issue Apr 29, 2021 · 10 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@robertfausk
Copy link
Contributor

What is the issue?

I can not upgrade to Symfony 5.x respectively I have two versions of mink-extension installed.

docker@94a71a61aa04:/var/www/html$ composer why friends-of-behat/mink-extension
robertfausk/behat-panther-extension  v1.0.6  requires  friends-of-behat/mink-extension (^2.3.0)  
soyuka/contexts                      3.3.3   requires  friends-of-behat/mink-extension (^2.3.1)  

docker@94a71a61aa04:/var/www/html$ composer why behat/mink-extension
genesis/behat-fail-aid  3.7.2  requires  behat/mink-extension (~2.0)  

How did it happen?

https://github.com/Behat/MinkExtension is outdated (last release on 5 Mar 2018).
As a drop in replacement https://github.com/FriendsOfBehat/MinkExtension can be used.

What should have happened?

behat-fail-aid automatically uses friends-of-behat/mink-extension instead of behat/mink-extension.
I do not know if there is an easy way to support both librarys without introducing a BC.

@forceedge01
Copy link
Owner

forceedge01 commented Mar 8, 2022

Hey @robertfausk ,

Thanks for raising this. I'll give this a go soon. I'd appreciate a pull request if you can raise one. It would be ace if the replacement worked out. For BC the other versions are still out there that can be used.

Related issue on behat/mink-extension Behat/MinkExtension#370

@forceedge01 forceedge01 added the dependencies Pull requests that update a dependency file label Mar 8, 2022
@robertfausk
Copy link
Contributor Author

robertfausk commented Mar 8, 2022

Hey @robertfausk ,

Thanks for raising this. I'll give this a go soon. I'd appreciate a pull request if you can raise one. It would be ace if the replacement worked out. For BC the other versions are still out there that can be used.

Question: Is the travis build still working?
The badge in the README points to a 404.
If travis is not an option anymore then I would recommend to use Gitbhub Actions and I can provide a PR for the use of GHA instead of travis if you want me to.
I would like to have a stable build before replacing behat/mink-extension with friends-of-behat/mink-extension.

behat-fail-aid automatically uses friends-of-behat/mink-extension instead of behat/mink-extension. I do not know if there is an easy way to support both librarys without introducing a BC.

It seems that the replace: in the composer.json of friends-of-behat/mink-extension has solved my issue.
forceedge01/behat-fail-aid is now working for me, even in symfony 5.x projects.
Nonetheless I think the old repo should be replaced.

https://github.com/FriendsOfBehat/MinkExtension/blob/df04efb3e88833208c3a99a3efa3f7e9f03854db/composer.json#L29-L31

https://stackoverflow.com/questions/18882201/how-does-the-replace-property-work-with-composer

@forceedge01
Copy link
Owner

Travis does work, best way to find out I guess is to push a change up. It may be an access related thing or the link may have changed since this last ran (10 months ago). I don't mind a github actions PR if you'd like to push one in (even if travis still runs on the side) just to see how GHA works out compared to Travis.

The friendsofBehat repo doesn't have an official stand point i.e it doesn't say that it replaces the old one neither is the old one abandoned - i'll dig a bit further to see what needs doing soon. Thanks for raising this.

@aaronbauman
Copy link

aaronbauman commented Jan 11, 2023

Any updates on this?

Not sure which package is responsible, but I'm now running into the "Ambiguous class resolution" described here: Behat/MinkExtension#370

FYI, latest releases for drupal/drupal-extension aka https://github.com/jhedstrom/drupalextension and dmore/behat-chrome-extension aka https://gitlab.com/behat-chrome/behat-chrome-extension have switched to using the friends-of-behat package.

@forceedge01
Copy link
Owner

@aaronbauman thanks for reporting. Can you run the commands in verboae mode and dump the output here?

Also what steps and commands have you executed to get this issue?

@aaronbauman
Copy link

Here's are the packages that (i think) create the conflict:

$ composer why friends-of-behat/mink-extension
You are running Composer with SSL/TLS protection disabled.
dmore/behat-chrome-extension 1.4.0  requires friends-of-behat/mink-extension (^2.0) 
drupal/drupal-extension      v4.2.1 requires friends-of-behat/mink-extension (^2)   

$ composer why behat/mink-extension
You are running Composer with SSL/TLS protection disabled.
genesis/behat-fail-aid      2.5.3      requires                   behat/mink-extension (~2.0@stable) 

And here's the full composer install output:

$ composer install --no-ansi --no-interaction --optimize-autoloader --no-progress -v
You are running Composer with SSL/TLS protection disabled.
> command: Drupal\Composer\Plugin\Scaffold\Plugin->onCommand
> pre-install-cmd: cweagans\Composer\Patches->checkPatches
Gathering patches for root package.
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Dependency resolution completed in 0.001 seconds
Nothing to install, update or remove
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Warning: Ambiguous class resolution, "Behat\MinkExtension\Listener\SessionsListener" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Listener/SessionsListener.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Listener/SessionsListener.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\Listener\FailureShowListener" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Listener/FailureShowListener.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Listener/FailureShowListener.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\Context\MinkAwareContext" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Context/MinkAwareContext.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Context/MinkAwareContext.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\Context\Initializer\MinkAwareInitializer" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Context/Initializer/MinkAwareInitializer.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Context/Initializer/MinkAwareInitializer.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\Context\MinkContext" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Context/MinkContext.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Context/MinkContext.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\Context\RawMinkContext" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\Selenium2Factory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/Selenium2Factory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\DriverFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/DriverFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/DriverFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\SeleniumFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SeleniumFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SeleniumFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\SauceLabsFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\BrowserStackFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\AppiumFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\SahiFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SahiFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/SahiFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\GoutteFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\Driver\ZombieFactory" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/ZombieFactory.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/Driver/ZombieFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Behat\MinkExtension\ServiceContainer\MinkExtension" was found in both "./vendor/behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php" and "./vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php", the first will be used.
76 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> post-install-cmd: Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->onDependenciesChangedEvent
Running PHPCodeSniffer Composer Installer
Nothing to install or update
> post-install-cmd: Drupal\Composer\Plugin\Scaffold\Plugin->postCmd
Scaffolding files for pantheon-systems/drupal-integrations:
  - Skip [web-root]/sites/default/settings.php because it already exists and overwrite is false.
> post-install-cmd: DrupalProject\composer\ScriptHandler::createRequiredFiles

@mariacha
Copy link

mariacha commented Feb 8, 2023

I resolved this by explicitly updating the friends-of-behat/mink-extension package:

composer update friends-of-behat/mink-extension

which should pull in the "replace" from the composer.json file linked.

Output:

➜ composer update friends-of-behat/mink-extension
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 1 removal
  - Removing behat/mink-extension (2.3.1)
  - Upgrading friends-of-behat/mink-extension (2.3.1 => v2.7.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 1 removal
  - Removing behat/mink-extension (2.3.1)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Upgrading friends-of-behat/mink-extension (2.3.1 => v2.7.2): Extracting archive

@forceedge01
Copy link
Owner

@aaronbauman its a bit late, but does the above solution work for you? The friends of behat repo does not have an official stand point (well they do which isn't very encouraging) hence I am reluctant on the change unless the old one gets abandoned.

@forceedge01
Copy link
Owner

@robertfausk thanks for your comment from awhile - it made me look at travis CI and indeed they've moved to a payment plan model since. Will fix this soon.

@aaronbauman
Copy link

composer install works now, thanks.

behat jobs are still failing, but i don't think it's this package that's causing the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

4 participants