Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45698

behat composer.json should have hard-coded supported versions

    Details

      Description

      Currently behat keeps failing, as symfony release something.

      For example, with change in symfony/DomCrawler https://github.com/symfony/DomCrawler/commit/5e8ad4367af467b9e40d6bb27d58a76a87cebb79, we are getting following error

      Warning: DOMXPath::query(): Invalid expression in /var/lib/jenkins/git_repositories/MOODLE_25_STABLE/vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/Crawler.php on line 832
      PHP Warning:  DOMXPath::query(): Invalid expression in /var/lib/jenkins/git_repositories/MOODLE_25_STABLE/vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/Crawler.php on line 832
      

      It would be nice to have know working version combinations in composer, so it won't fail by surprise.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            dmonllao David Monllaó added a comment -

            Hi,

            I experienced the same problem last day I was working, I remember that the problem was also in stable branches, where it should not be, as the hardcoded versions in composer.json prevents this kind of problems.

            Show
            dmonllao David Monllaó added a comment - Hi, I experienced the same problem last day I was working, I remember that the problem was also in stable branches, where it should not be, as the hardcoded versions in composer.json prevents this kind of problems.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Requesting review, I will do the following after review:

            1. Replace branches with moodle/composer.json tag change (for integration)
            2. Pull changes on moodle-behat-extension.

            For testing: please use attached composer.json.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Requesting review, I will do the following after review: Replace branches with moodle/composer.json tag change (for integration) Pull changes on moodle-behat-extension. For testing: please use attached composer.json.
            Hide
            cibot CiBoT added a comment -

            Results for MDL-45698

            Show
            cibot CiBoT added a comment - Results for MDL-45698 Remote repository: https://github.com/rajeshtaneja/moodle-behat-extension.git Remote branch dev-45701 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/3585 Error: The dev-45701 branch at https://github.com/rajeshtaneja/moodle-behat-extension.git and master does not have any common ancestor.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Nothing that symfony/DomCrawler and other components are not mentioned here, as symfony's use same version for all components.
            https://github.com/symfony/symfony/blob/master/composer.json#L26

            Show
            rajeshtaneja Rajesh Taneja added a comment - Nothing that symfony/DomCrawler and other components are not mentioned here, as symfony's use same version for all components. https://github.com/symfony/symfony/blob/master/composer.json#L26
            Hide
            dmonllao David Monllaó added a comment -

            Hi Raj,

            About adding symfony, it makes sense and even more if all of it's components uses the same version, the browser one is probably the most used of them so if something have to fail will probably be there; IMO would be good to include in moodle-behat-extension/composer.json all the components that we are extensively using (like symfony or the web-driver one that I can think of now)

            About hardcoding versions also in master, the more we extend the framework, advanced features, add dodgy xpath queries... the more we are exposed to 3rd party libraries bugs, so for me seems a good option to hardcode them. However, if we do it, we should, at some point, update to the last dependencies minor versions, maybe in the soft freeze to avoid last minute problems.

            Show
            dmonllao David Monllaó added a comment - Hi Raj, About adding symfony, it makes sense and even more if all of it's components uses the same version, the browser one is probably the most used of them so if something have to fail will probably be there; IMO would be good to include in moodle-behat-extension/composer.json all the components that we are extensively using (like symfony or the web-driver one that I can think of now) About hardcoding versions also in master, the more we extend the framework, advanced features, add dodgy xpath queries... the more we are exposed to 3rd party libraries bugs, so for me seems a good option to hardcode them. However, if we do it, we should, at some point, update to the last dependencies minor versions, maybe in the soft freeze to avoid last minute problems.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks for the review David,

            Sorry I didn't get which components are you mentioning here David.

            My point was to hard-code to that latest version and keep master up-to-date. But when I talked to Damyon, he made a very good point about updating it similar to tinymce or any other 3rd party library. Which is 1 month before release.

            So 2.7 and master will follow till last point.

            FYI: Current branch testing needs version 1.25.13, 1.26.9 and 1.27.10

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks for the review David, Sorry I didn't get which components are you mentioning here David. My point was to hard-code to that latest version and keep master up-to-date. But when I talked to Damyon, he made a very good point about updating it similar to tinymce or any other 3rd party library. Which is 1 month before release. So 2.7 and master will follow till last point. FYI: Current branch testing needs version 1.25.13, 1.26.9 and 1.27.10
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Aja, yep, as talked, adding more exact versions, specially in stable is perfect. And yes, we should keep the old (before the crawler fail) version until new releases happen.

            So it looks perfect... giving them a try...

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Aja, yep, as talked, adding more exact versions, specially in stable is perfect. And yes, we should keep the old (before the crawler fail) version until new releases happen. So it looks perfect... giving them a try...
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            Aja, just adding here the way I had to modify my composer.json to be able to get your branches, coz it was really tricky (see the double "dev-"). Sure there is another way but I was not able to get it:

            {
                "repositories" : [
                    {
                        "type": "vcs",
                        "url": "https://github.com/rajeshtaneja/moodle-behat-extension"
                    }
                ],
                "require-dev": {
                    "phpunit/phpunit": "3.7.*",
                    "phpunit/dbUnit": "1.2.*",
                    "moodlehq/behat-extension": "dev-dev-45701-m26"
                }
            }
            

            Performing a 26_STABLE run now...

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited Aja, just adding here the way I had to modify my composer.json to be able to get your branches, coz it was really tricky (see the double "dev-"). Sure there is another way but I was not able to get it: { "repositories" : [ { "type": "vcs", "url": "https://github.com/rajeshtaneja/moodle-behat-extension" } ], "require-dev": { "phpunit/phpunit": "3.7.*", "phpunit/dbUnit": "1.2.*", "moodlehq/behat-extension": "dev-dev-45701-m26" } } Performing a 26_STABLE run now...
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            25_STABLE results using dev-45701-m25:

            Moodle 2.5.6+ (Build: 20140522), pgsql, a267e328486bab57eda672d10505ae4de9783049
            Server OS "Darwin", Browser: "firefox"
             
            271 escenarios (271 exitosos)
            9252 pasos (9252 exitosos)
            193m29.486s
            

            26_STABLE results using dev-45701-m26:

            Moodle 2.6.3+ (Build: 20140522), pgsql, 56f23662b129d6e3fb9493a9eebcfb57b5b1d565
            Server OS "Darwin", Browser: "firefox"
             
            356 escenarios (353 exitosos, 3 fallidos)
            12308 pasos (12272 exitosos, 33 omitidos, 3 fallidos)
            179m22.153s
            

            (the 3 failures are PHP Notices: Undefined property: stdClass::$aliases in /Users/stronk7/git_moodle/testing/mod/glossary/edit.php on line 94, will look/create a issue for them)

            27_STABLE results using dev-45701:

            Moodle 2.7+ (Build: 20140522), pgsql, 83bc3ccfdf1f3319aa54cc14fe504f05927f20a2
            Server OS "Darwin", Browser: "firefox"
             
            01. Xpath matching locator "//li[@id='section-3']/descendant::div[@class='section-modchooser']/span/a" not found.
                In step `Given I add a "Page" to section "3"'. # behat_course::i_add_to_section()
                From scenario `Activity availability display'. # /Users/stronk7/git_moodle/testing/availability/tests/behat/display_availability.feature:43
                Of feature `display_availability'.             # /Users/stronk7/git_moodle/testing/availability/tests/behat/display_availability.feature
             
            404 escenarios (403 exitosos, 1 fallidos)
            14014 pasos (13994 exitosos, 19 omitidos, 1 fallidos)
            223m26.475s
            

            (the failure was not reproducible in a second execution, I suppose it was a random one)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited 25_STABLE results using dev-45701-m25: Moodle 2.5.6+ (Build: 20140522), pgsql, a267e328486bab57eda672d10505ae4de9783049 Server OS "Darwin", Browser: "firefox"   271 escenarios (271 exitosos) 9252 pasos (9252 exitosos) 193m29.486s 26_STABLE results using dev-45701-m26: Moodle 2.6.3+ (Build: 20140522), pgsql, 56f23662b129d6e3fb9493a9eebcfb57b5b1d565 Server OS "Darwin", Browser: "firefox"   356 escenarios (353 exitosos, 3 fallidos) 12308 pasos (12272 exitosos, 33 omitidos, 3 fallidos) 179m22.153s (the 3 failures are PHP Notices: Undefined property: stdClass::$aliases in /Users/stronk7/git_moodle/testing/mod/glossary/edit.php on line 94, will look/create a issue for them) 27_STABLE results using dev-45701: Moodle 2.7+ (Build: 20140522), pgsql, 83bc3ccfdf1f3319aa54cc14fe504f05927f20a2 Server OS "Darwin", Browser: "firefox"   01. Xpath matching locator "//li[@id='section-3']/descendant::div[@class='section-modchooser']/span/a" not found. In step `Given I add a "Page" to section "3"'. # behat_course::i_add_to_section() From scenario `Activity availability display'. # /Users/stronk7/git_moodle/testing/availability/tests/behat/display_availability.feature:43 Of feature `display_availability'. # /Users/stronk7/git_moodle/testing/availability/tests/behat/display_availability.feature   404 escenarios (403 exitosos, 1 fallidos) 14014 pasos (13994 exitosos, 19 omitidos, 1 fallidos) 223m26.475s (the failure was not reproducible in a second execution, I suppose it was a random one)
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            About the 26_STABLE failures.... (--tags '@block_glossary_random')

            0) I was unable to reproduce them in the browser.
            1) Using "dev-45701-m26" they happen. Constantly.
            2) Using "dev-45701" they don't happen. Constantly.

            So, it seems that there is some bug in the "dev-45701-m26" combination of versions causing empty aliases not to be passed or so. I'm not going to create a new issue because it seems directly related with this.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited About the 26_STABLE failures.... (--tags '@block_glossary_random') 0) I was unable to reproduce them in the browser. 1) Using "dev-45701-m26" they happen. Constantly. 2) Using "dev-45701" they don't happen. Constantly. So, it seems that there is some bug in the "dev-45701-m26" combination of versions causing empty aliases not to be passed or so. I'm not going to create a new issue because it seems directly related with this. Ciao
            Hide
            rajeshtaneja Rajesh Taneja added a comment - - edited

            Strange,

            for me 26 is passing

            344 scenarios (344 passed)
            12056 steps (12056 passed)
            189m49.665s
            

            Aha... It's Moodle 2.6.2+ (Build: 20140502), pgsql, f2791d4944e66ed18a5edd13bd6b063527c45310
            Server OS "Linux", Browser: "firefox". Seems something added later, checking on 2.6.3+

            Show
            rajeshtaneja Rajesh Taneja added a comment - - edited Strange, for me 26 is passing 344 scenarios (344 passed) 12056 steps (12056 passed) 189m49.665s Aha... It's Moodle 2.6.2+ (Build: 20140502), pgsql, f2791d4944e66ed18a5edd13bd6b063527c45310 Server OS "Linux", Browser: "firefox". Seems something added later, checking on 2.6.3+
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Aha.. Fixed it.

            I should have used 2.3.13 rather than older version.

            Fixed it, running test on nightly...

            As per master it's passing for me. Probably a random fail there, running whole suite locally to ensure.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Aha.. Fixed it. I should have used 2.3.13 rather than older version. Fixed it, running test on nightly... As per master it's passing for me. Probably a random fail there, running whole suite locally to ensure.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Cause of problem was https://github.com/symfony/DomCrawler/commit/06357a33e4b33351a37f5ae5c27259bbd8f96007
            Textarea was not returning value in glossary, by setting a default (setDefault), worked ....

            Anyway, this was fixed and 2.3.13 passed that failure point. Waiting for the whole suite to finish.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Cause of problem was https://github.com/symfony/DomCrawler/commit/06357a33e4b33351a37f5ae5c27259bbd8f96007 Textarea was not returning value in glossary, by setting a default (setDefault), worked .... Anyway, this was fixed and 2.3.13 passed that failure point. Waiting for the whole suite to finish.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Hack works, https://github.com/rajeshtaneja/moodle/compare/moodle:master...wip-mdl-45698 for now
            Not sure why email gets reset randomly, because of which form is not saved and next step fails. Above patch, removes that randomness.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Hack works, https://github.com/rajeshtaneja/moodle/compare/moodle:master...wip-mdl-45698 for now Not sure why email gets reset randomly, because of which form is not saved and next step fails. Above patch, removes that randomness.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            Aha,

            26_STABLE with dev-45701-m26 applied. All ok.

            Moodle 2.6.3+ (Build: 20140522), pgsql, 56f23662b129d6e3fb9493a9eebcfb57b5b1d565
            Server OS "Darwin", Browser: "firefox"
             
            356 escenarios (356 exitosos)
            12311 pasos (12311 exitosos)
            179m29.682s
            

            27_STABLE with dev-45701 and wip-mdl-45698 (e479a07) applied. Ongoing...

            Moodle 2.7+ (Build: 20140522), pgsql, c2b31904ec89bcb3756b23bcb83cb03862b2b393
            Server OS "Darwin", Browser: "firefox"
             
            404 escenarios (404 exitosos)
            14020 pasos (14020 exitosos)
            222m20.608s
            

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited Aha, 26_STABLE with dev-45701-m26 applied. All ok. Moodle 2.6.3+ (Build: 20140522), pgsql, 56f23662b129d6e3fb9493a9eebcfb57b5b1d565 Server OS "Darwin", Browser: "firefox"   356 escenarios (356 exitosos) 12311 pasos (12311 exitosos) 179m29.682s 27_STABLE with dev-45701 and wip-mdl-45698 (e479a07) applied. Ongoing... Moodle 2.7+ (Build: 20140522), pgsql, c2b31904ec89bcb3756b23bcb83cb03862b2b393 Server OS "Darwin", Browser: "firefox"   404 escenarios (404 exitosos) 14020 pasos (14020 exitosos) 222m20.608s
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            So it seems we are back to all passing, yay. Next steps then, should be:

            1) push the changes to behat-extension and tag them
            2) move moodle's composer.json to point to those tags
            3) happiness

            Thanks, Raj!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - So it seems we are back to all passing, yay. Next steps then, should be: 1) push the changes to behat-extension and tag them 2) move moodle's composer.json to point to those tags 3) happiness Thanks, Raj!
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            I have updated mater pointing to 1.28.3 and 27 branch is different and no need to wait for MDL-45408.

            If MDL-45408 has to go next week then I will update master commit pointing to 1.27.10

            Show
            rajeshtaneja Rajesh Taneja added a comment - I have updated mater pointing to 1.28.3 and 27 branch is different and no need to wait for MDL-45408 . If MDL-45408 has to go next week then I will update master commit pointing to 1.27.10
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks Eloy, for all the testing on this.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks Eloy, for all the testing on this.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Raj - this has been integrated now.

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Raj - this has been integrated now.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Results on local machine.

            Moodle 2.8dev (Build: 20140522), pgsql, f65427b6607be376f5c0aa96e54ad76889513838
            Server OS "Linux", Browser: "firefox"
            Started at 29-05-2014, 11:10

            404 scenarios (404 passed)
            14020 steps (14020 passed)
            285m5.402s
            

            Moodle 2.6.3+ (Build: 20140522), pgsql, 18c31e25b608b5beaecb3e7a5a6b247532693ff0
            Server OS "Linux", Browser: "firefox"
            Started at 29-05-2014, 11:10

            356 scenarios (356 passed)
            12311 steps (12311 passed)
            242m9.234s
            

            Moodle 2.5.6+ (Build: 20140522), pgsql, 33fdd3fd874edecf6b417dda6c57ff3e9a6129a5
            Server OS "Linux", Browser: "firefox"
            Started at 29-05-2014, 11:18

            271 scenarios (271 passed)
            9249 steps (9249 passed)
            254m7.263s
            

            On nightly 26 there is 1 fail, but that is random as it was running all 3 behat's together.
            25 and master still running on nightly.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Results on local machine. Moodle 2.8dev (Build: 20140522), pgsql, f65427b6607be376f5c0aa96e54ad76889513838 Server OS "Linux", Browser: "firefox" Started at 29-05-2014, 11:10 404 scenarios (404 passed) 14020 steps (14020 passed) 285m5.402s Moodle 2.6.3+ (Build: 20140522), pgsql, 18c31e25b608b5beaecb3e7a5a6b247532693ff0 Server OS "Linux", Browser: "firefox" Started at 29-05-2014, 11:10 356 scenarios (356 passed) 12311 steps (12311 passed) 242m9.234s Moodle 2.5.6+ (Build: 20140522), pgsql, 33fdd3fd874edecf6b417dda6c57ff3e9a6129a5 Server OS "Linux", Browser: "firefox" Started at 29-05-2014, 11:18 271 scenarios (271 passed) 9249 steps (9249 passed) 254m7.263s On nightly 26 there is 1 fail, but that is random as it was running all 3 behat's together. 25 and master still running on nightly.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Ok, so it seems this is ready to be considered passed (no matter there are some issues with PhantomJS that has been decided to be moved to different issue for next week).

            Am I correct? +-1 ?

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Ok, so it seems this is ready to be considered passed (no matter there are some issues with PhantomJS that has been decided to be moved to different issue for next week). Am I correct? +-1 ? Ciao
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Yes, it's all good.
            +1

            Show
            rajeshtaneja Rajesh Taneja added a comment - Yes, it's all good. +1
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Passing this, as behat is passing.

            I fail in 27 and master phantomjs only, probably another issue and not related to symfony version fix.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Passing this, as behat is passing. I fail in 27 and master phantomjs only, probably another issue and not related to symfony version fix.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Closing this as fixed, many thanks for your effort!

            Some people think architecture is
            about the genius sketch; I don't.
            Great architecture is a collaboration
            among a lot of people
            over a long period of time.

            – Joshua Prince-Ramus

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Closing this as fixed, many thanks for your effort! Some people think architecture is about the genius sketch; I don't. Great architecture is a collaboration among a lot of people over a long period of time. – Joshua Prince-Ramus

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jul/14