Problem/Motivation

As we could see in the new 1.7.1 release of behat/mink https://github.com/minkphp/Mink/releases/tag/v1.7.1
'tests' dir has been removed from archives generated by Github:

Misc:

Removed the Mink testsuite from archives generated by Github to make them smaller

So now composer up and composer drupal-update causes an error:

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing behat/mink (v1.7.0)
  - Installing behat/mink (v1.7.1)
    Loading from cache

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Script Drupal\Core\Composer\Composer::vendorTestCodeCleanup handling the post-package-update event terminated with an exception


  [RuntimeException]
  The directory 'tests' in package 'behat/mink' does not exist.

Proposed resolution

Remove 'tests' from $packageToCleanup in Composer.php

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Comments

fortis created an issue. See original summary.

fortis’s picture

Issue summary: View changes
fortis’s picture

fortis’s picture

Status: Active » Needs review
fortis’s picture

Issue summary: View changes
fortis’s picture

Issue summary: View changes
cilefen’s picture

Issue tags: -behat/mink, -Behat, -core

Removed unneeded tags.

VanLuda’s picture

@fortis, I'm not sure how to use the update. I'm trying to install the commerceguys/addressing from the command line and I'm getting the "The directory 'tests' in package 'behat/mink' does not exist." error.

fortis’s picture

@VanLuda did you tried #3 path?

RavindraSingh’s picture

I am able to test with composer up command but not able to test with composer drupal-update command. @fortis, can you please add steps to tests.

esclapes’s picture

Patch in #3 worked for me.

peterpoe’s picture

Pach #3 tested with composer drupal-update, worked.

bojanz’s picture

Status: Needs review » Closed (duplicate)

Let's continue in #2664274: Combination of --prefer-dist and .gitattributes confuses our vendor test cleanup, that one is closer (and describes that --prefer-source gives you tests but --prefer-dist doesn't, so our cleanup script needs to be smarter)

jacov’s picture

#3 works

iampuma’s picture

#3 works thanks

Justincletus’s picture

patch #3 tested with composer drupal-update, worked.

fortis’s picture

Status: Closed (duplicate) » Needs review

@bojanz, okay, but $packageToCleanup still should be updated with #3

fortis’s picture

Title: RuntimeException on composer up. Behat/Mink 'tests' cleanup are no longer required » Update $packageToCleanup, 'tests' cleanup are no longer required for Behat/Mink package
bojanz’s picture

@fortis
No, that is incorrect. Mink still has a tests directory: https://github.com/Behat/Mink/tree/master/tests
And if you install/update with --prefer-source, you will get it.

This is explained in the other issue, libraries are now excluding tests only on --prefer-dist.

fortis’s picture