Problem/Motivation
See the parent issue #2232861: Create BrowserTestBase for web-testing on top of Mink for complete details.
Behat's Mink extension, and Mink's driver for Goutte, should be added to Drupal core so that the patch in #2232861: Create BrowserTestBase for web-testing on top of Mink easier to review.
Proposed Resolution
Add the behat/mink
and behat/mink-goutte-driver
packages to core's composer.json. This change has already been approved by Dries and being tackled in this issue as per #2232861-204: Create BrowserTestBase for web-testing on top of Mink.
Remaining tasks
Review and commit the patch.
User interface changes
None.
API changes
None. Only adding new components.
Commit message
git commit -m 'Issue #2433009 by hussainweb, grom358, daffie, larowlan, alexpott, pcambra, benjy, jibran, phenaproxima, moshe weitzman, nick_schuch, neclimdul: Add Mink, with Goutte driver, to core'
Comment | File | Size | Author |
---|---|---|---|
#17 | 2433009-mink_goutte_et_al-composer_changes-17.patch | 13.24 KB | neclimdul |
#17 | 2433009-mink_goutte_et_al-composer_changes-17.interdiff.txt | 12.13 KB | neclimdul |
#17 | 2433009-mink_goutte_et_al-17.patch | 990.79 KB | neclimdul |
Comments
Comment #1
phenaproximaChanging category.
Comment #2
hussainwebInitial patch, and tweaking the IS a bit.
Comment #3
hussainwebComment #4
webchickCan someone please help craft an accurate commit message and add it to the top of the issue summary? There were lots more people involved over at #2232861: Create BrowserTestBase for web-testing on top of Mink and want to make sure they get credit, too. :)
Comment #5
hussainwebI have added all the names from that issue to a commit message in IS. Here it is again:
git commit -m 'Issue #2433009 by hussainweb, grom358, daffie, larowlan, alexpott, pcambra, benjy, jibran, phenaproxima, moshe weitzman, nick_schuch: Add Mink, with Goutte driver, to core'
The very first patch in that issue has changes to composer.json, which is what this is. That is why, I am keeping all the names.
Comment #6
neclimdulApplied composer changes and ran composer and for all intents and purposes came up with the same patch. Since this is already approved and we've got the commit message I'll bump it RTBC.
Comment #7
daffie CreditAttribution: daffie commentedIs blocking #2232861: Create BrowserTestBase for web-testing on top of Mink.
Comment #8
daffie CreditAttribution: daffie commented+1 for RTBC.
Comment #9
daffie CreditAttribution: daffie commentedThe parent issue is major so should this one.
Comment #10
alexpottThe patch in #5 changed the following file perms to 644 - whilst that is the correct permissions we should not changing them - we should be filing upstream issues.
This issue is a major task that will eventually improve testing significantly and the disruption it introduces is zero. Per https://www.drupal.org/core/beta-changes, this is a good change to complete during the Drupal 8 beta phase. Committed 2b96082 and pushed to 8.0.x. Thanks!
Comment #12
larowlanSorry to be a pain, but I think this needs to be rolled back.
We ended up adding guzzle 3 back into core.
goutte should have been 2.0 (I ported it to guzzle 5 as part of #2232861: Create BrowserTestBase for web-testing on top of Mink)
Comment #13
larowlanTo make this work correctly, we have to nominate goutte 2.0 in our composer.json so composer doesn't get a choice between 1.x and 2.x (mink-goutte-driver has
require: fabot/goutte: ~1.0.4|~2.0
).So what happened was composer said - ok 1.0.4 is ok, which relies on guzzle 3.
If we nominate ~2.0 in our code, we'll get the right one.
Comment #15
neclimdulspent 2 min testing this and ~2.0 doesn't work. there isn't a release in packagist that has the 5 support.
Comment #16
neclimdulSorry looked into this more that my last comment wasn't really clear enough. It doesn't work but the reason is a little more involved. Larowlan upgraded Goute to support 4.* and those changes are in the 2.0 releases of Goute but core has 5.* and the commit that raises the dependencies in their composer.json is not in any releases.
https://github.com/FriendsOfPHP/Goutte/commit/33b16e073667a3408b6a1e8c46...
We could probably use dev-master which is probably what the other patch was doing which isn't really the greatest or we can
bugask very nicely for Fabien to make a release.Comment #17
neclimdulIn the interest of unblocking things, dev-master might look like this.
Comment #18
daffie CreditAttribution: daffie commentedThe goutte browser driver to be used on top of the functional testsuite mink is not chosen because it is the browser driver that we want to use. The goutte browser driver has been chosen because it does not support javascript. And that is because the testbot does not support javascript. Of course we want functional testing with javascript enabled and that means that the testbot needs to support it. #2232861: Create BrowserTestBase for web-testing on top of Mink lays the foundation so that work on the testbot for supporting javascript can begin.
As long as functional testsuite mink does not support javascript it will not be used be drupal core. So using the goutte browser driver in a dev-master version is in my eyes not a big problem. Although I wood rather not use the dev-master release of any kind of library in drupal core, I this case it is temporary and only used as scaffolding and not actively used by drupal core.
Comment #19
daffie CreditAttribution: daffie commentedThe following libraries are added in this patch:
All of these libraries are new in Drupal core, so problems there.
I have combined this patch with the latest patch from #2232861: Create BrowserTestBase for web-testing on top of Mink and let the testbot have a look at it. It came back green.
It all looks good to me. I have only one question left:
Can someone explain to me what
"fabpot/goutte": 20
does and why it is needed.Comment #20
neclimdulWhat is the problem? The interdiff should show that the only change fromt he committed version is the removal of the guzzle libraries and symfony/finder and the change of the goutte version.
That is in the lock file so it was obviously added composer. If my understanding is correct the reason is I explicitly installed goutte from a dev version and core's composer.json requires stable packages. That is to say it does not have
"minimum-stability": "dev",
. This is flagging that this package can have a different stability from the general rule for the package. When we move to a non-dev release this would go away.Comment #21
neclimdulSorry, I didn't mean to change the status because I wasn't sure what the library problem was.
Comment #22
daffie CreditAttribution: daffie commentedIt all looks good to me.
The following libraries are added in this patch:
It gets a RTBC from me.
For the committer:
This code is added by composer. Neclimdul and myself have the idea that the code is okay. But I would like to mention it anyway.
Comment #23
larowlan+1 - no extra guzzle packages and the 2.x branch of Goutte - thanks folks
Comment #24
larowlanOpened https://github.com/FriendsOfPHP/Goutte/issues/202
Comment #25
webchickOk, let's try this again.
Committed and pushed to 8.0.x. Thanks!
Comment #27
hussainwebI am not sure if I'm missing something. The commit mentioned earlier only shows that core/composer.json and core/composer.lock have been changed, but the libraries themselves have not been added.
Comment #28
webchickOH dang it. I committed the wrong patch. Sec.
Comment #29
webchickThere that should be much more betterer. :)
Comment #31
hussainwebYes, looks fine now. :)
Comment #32
larowlan@fabpot just rolled 2.0.3 so can we get a follow up to remove dev-master for Goutte?
Comment #33
hussainwebCreated followup at #2440937: Update release for Goutte driver.