symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.94k stars 222 forks source link

Composer, browser-kit, dependency management, symfony 3.4 #173

Closed jhchnc closed 5 years ago

jhchnc commented 5 years ago

I have three basic environments, 2 of which are interrelated.

Local Ubuntu desktop, php 7.2.15 -- WORKS Local Virtualbox running on Ubuntu local Ubuntu desktop, php 7.2.15 -- FAILS Remote Staging server, php 7.2.10 -- FAILS

Trying to do SYMFONY_ENV=dev composer install

Problem 1
- Conclusion: don't install symfony/symfony v3.4.22
- Conclusion: don't install symfony/symfony v3.4.21
- Conclusion: don't install symfony/symfony v3.4.20
- Conclusion: don't install symfony/symfony v3.4.19
- Conclusion: don't install symfony/symfony v3.4.18
- Conclusion: don't install symfony/symfony v3.4.17
- Conclusion: don't install symfony/symfony v3.4.16
- Conclusion: don't install symfony/symfony v3.4.15
- Conclusion: don't install symfony/symfony v3.4.14
- Conclusion: don't install symfony/symfony v3.4.13
- Conclusion: don't install symfony/symfony v3.4.12
- Conclusion: don't install symfony/symfony v3.4.11
- Conclusion: don't install symfony/symfony v3.4.10
- Conclusion: don't install symfony/symfony v3.4.9
- Conclusion: don't install symfony/symfony v3.4.8
- Conclusion: don't install symfony/symfony v3.4.7
- Conclusion: don't install symfony/symfony v3.4.6
- Conclusion: don't install symfony/symfony v3.4.5
- Conclusion: don't install symfony/symfony v3.4.4
- Conclusion: don't install symfony/symfony v3.4.3
- Installation request for symfony/panther ^0.3.0 -> satisfiable by symfony/panther[v0.3.0].
- Conclusion: don't install symfony/symfony v3.4.2
- Conclusion: don't install symfony/symfony v3.4.1
- symfony/panther v0.3.0 requires symfony/browser-kit ^4.0 -> satisfiable by symfony/browser-kit[v4.2.0, v4.2.1, v4.2.2, v4.2.3].
- don't install symfony/browser-kit v4.2.0|don't install symfony/symfony v3.4.0
- don't install symfony/browser-kit v4.2.1|don't install symfony/symfony v3.4.0
- don't install symfony/browser-kit v4.2.2|don't install symfony/symfony v3.4.0
- don't install symfony/browser-kit v4.2.3|don't install symfony/symfony v3.4.0
- Installation request for symfony/symfony ^3.4 -> satisfiable by symfony/symfony[v3.4.0, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9].

Composer.json

"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-4": {
        "AppBundle\\": "src/AppBundle"
    },
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
    "psr-4": { "Tests\\": "tests/" },
    "files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
    "php": ">=7.1",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/orm": "^2.5",
    "friendsofsymfony/rest-bundle": "^2.4",
    "incenteev/composer-parameter-handler": "^2.0",
    "jms/serializer-bundle": "^2.4",
    "nesbot/carbon": "^1.34",
    "sensio/distribution-bundle": "^5.0.19",
    "sensio/framework-extra-bundle": "^5.0.0",
    "symfony/monolog-bundle": "^3.1.0",
    "symfony/polyfill-apcu": "^1.0",
    "symfony/swiftmailer-bundle": "^2.6.4",
    "symfony/symfony": "^3.4",
    "twig/twig": "^1.0||^2.0"
},
"require-dev": {
    "symfony/debug": "^3.4",
    "sensio/generator-bundle": "^3.0",
    "symfony/phpunit-bridge": "^3.4",
    "symfony/var-dumper": "^3.4",
    "symfony/panther": "^0.2.0",
    "symfony/browser-kit": "^4.2"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "platform": {
        "php": "7.1.3"
    },
    "sort-packages": true
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "3.4-dev"
    }
}

HOWEVER, if I remove the following lines from "require-dev" of composer.json

    "symfony/panther": "^0.2.0",
    "symfony/browser-kit": "^4.2"

THEN, it works within ALL three environments!

Naturally, I am removing my ./vendor folder and composer.lock file before I run each test.

Any help is greatly appreciated!

xabbuh commented 5 years ago

The symfony/symfony package already includes the BrowserKit component. You cannot require it in a different version in require-dev.

jhchnc commented 5 years ago

Thank you. I now see that in the symfony 3.4 branch composer.json. However, when removing just the browser-kit requirement, I now get:

Problem 1
    - Installation request for symfony/symfony ^3.4.22 -> satisfiable by symfony/symfony[v3.4.22].
    - symfony/panther v0.2.0 requires symfony/browser-kit ^4.0 -> satisfiable by symfony/browser-kit[v4.0.0, v4.0.1, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0, v4.2.1, v4.2.2, v4.2.3].
    - don't install symfony/browser-kit v4.0.0|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.1|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.10|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.11|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.12|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.13|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.14|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.15|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.2|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.3|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.4|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.5|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.6|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.7|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.8|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.0.9|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.0|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.1|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.10|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.11|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.2|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.3|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.4|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.5|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.6|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.7|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.8|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.1.9|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.2.0|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.2.1|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.2.2|don't install symfony/symfony v3.4.22
    - don't install symfony/browser-kit v4.2.3|don't install symfony/symfony v3.4.22
    - Installation request for symfony/panther ^0.2.0 -> satisfiable by symfony/panther[v0.2.0].

I get a similar error whether specifying panther v3 or v2.

I think this initial error is why I added the browser-kit to require-dev initially...

jhchnc commented 5 years ago

If I move

        "symfony/panther": "^0.2.0",
     "symfony/browser-kit": "^4.0"

To require instead of require-dev, then I get original issue -- joy on desktop, no joy on Virtualbox or remote environments.

If I remove references to browser-kit entirely, and simply leave symfony\panther' inrequire`, then the process will not run in any environment, including my local desktop.

I should mention I'm using symfony/framework-standard-edition

Thanks very much for any assistance. When I've got it working, panther has been an amazing asset for us (I'm at a large private Univ. in the US).

xabbuh commented 5 years ago

Looking at the dependencies I am afraid that you won't be able to use Panther with Symfony 3.4 but need to update to Symfony 4 first.

jhchnc commented 5 years ago

I have a composer configuration which I have been able to use locally with require-dev if I run composer through the desktop CLI of a shared folder that my virtual machine uses as well. With a passing composer install, I have zero issues running panther tests, and have found it incredibly useful.

On production I can use the same composer file run with --no-dev, and my application works great.

I can get past all of this in non-ideal ways, but was looking for an ideal way.

Thanks for your help in understanding that I'm not going crazy :) We are pinned to 3.4 because it's a LTS release.

navitronic commented 5 years ago

I have a fork that supports Symfony v3.4.

https://github.com/estimateone/panther

I need to spend some time to get the latest changes into it, but we’ve found it functional for a few months.

On 3 Mar 2019, at 3:10 am, jhchnc notifications@github.com wrote:

I have a composer configuration which I have been able to use locally with require-dev if I run composer through the desktop CLI of a shared folder that my virtual machine uses as well. With a passing composer install, I have zero issues running panther tests, and have found it incredibly useful.

On production I can use the same composer file run with --no-dev, and my application works great.

I can get past all of this in non-ideal ways, but was looking for an ideal way.

Thanks for your help in understanding that I'm not going crazy :) We are pinned to 3.4 because it's a LTS release.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jhchnc commented 5 years ago

@navitronic I will give that a look! Thank you for posting.

jhchnc commented 5 years ago

@navitronic thank you VERY much!

jhchnc commented 5 years ago

@navitronic Would you suggest use of your three-point-four branch, or your master branch?