Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Unit tests
    • Labels:

      Description

      The following unit test failures appear to be caused by missing proxy settings:

      3) moodlesimplepie_testcase::test_getfeed
      Failed to load the sample RSS file. Please check your proxy settings in Moodle. %s
      Failed asserting that 'cURL Error: couldn't connect to host' is null.
       
      C:\Users\sm449\workspace\core-moodle-github\lib\tests\rsslib_test.php:56
      C:\Users\sm449\workspace\core-moodle-github\lib\phpunit\lib.php:1058
      C:\Program Files (x86)\PHP\phpunit:46
       
      4) moodlesimplepie_testcase::test_redirect
      Failed asserting that 'cURL Error: connect() timed out!' is null.
       
      C:\Users\sm449\workspace\core-moodle-github\lib\tests\rsslib_test.php:140
      C:\Users\sm449\workspace\core-moodle-github\lib\phpunit\lib.php:1058
      C:\Program Files (x86)\PHP\phpunit:46

      I think when creating the test database environment/config, it should initialise the proxyhost (etc) variables from the real config table, and it probably isn't.

      Note: this is just my assumption, if you need me to debug it more, I can do so.

        Gliffy Diagrams

          Activity

          Hide
          Petr Skoda added a comment -

          Hmm, good idea, I agree we should whitelist this setting from the config.php and document it. Thanks a lot for the report.

          Show
          Petr Skoda added a comment - Hmm, good idea, I agree we should whitelist this setting from the config.php and document it. Thanks a lot for the report.
          Hide
          Petr Skoda added a comment -

          Hi Sam, please test the patch before integration, please note the proxy settings must be defined directly in config.php

          Show
          Petr Skoda added a comment - Hi Sam, please test the patch before integration, please note the proxy settings must be defined directly in config.php
          Hide
          Sam Marshall added a comment -

          Thanks Petr! I can confirm this works, please go ahead with integration. (Unit tests all pass for me now, well except two that are because I don't have the 'intl' extension, but I expect I can fix that in php.ini, it's not related to this.)

          It's a bit unfortunate that the setting has to be included in config.php but as long as we can add this to the documentation about setting up phpunit, it should be fine.

          Show
          Sam Marshall added a comment - Thanks Petr! I can confirm this works, please go ahead with integration. (Unit tests all pass for me now, well except two that are because I don't have the 'intl' extension, but I expect I can fix that in php.ini, it's not related to this.) It's a bit unfortunate that the setting has to be included in config.php but as long as we can add this to the documentation about setting up phpunit, it should be fine.
          Hide
          Petr Skoda added a comment -

          thanks a lot!

          Show
          Petr Skoda added a comment - thanks a lot!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Poltawski added a comment -

          Urm, webproxy is admin_setting_heading

          Show
          Dan Poltawski added a comment - Urm, webproxy is admin_setting_heading
          Hide
          Petr Skoda added a comment -

          oh, fixed, sorry.

          Show
          Petr Skoda added a comment - oh, fixed, sorry.
          Hide
          Dan Poltawski added a comment -

          thanks!

          Show
          Dan Poltawski added a comment - thanks!
          Hide
          Adrian Greeve added a comment -

          Test passed after a lot of fooling around. After Dan had a look we finally narrowed down that you need to include proxy settings in config.php.
          Test passed.

          Show
          Adrian Greeve added a comment - Test passed after a lot of fooling around. After Dan had a look we finally narrowed down that you need to include proxy settings in config.php. Test passed.
          Hide
          Sam Marshall added a comment -

          Adrian: The proxy issue initially caused me trouble as well. To ensure this is clear, I have added it to the documentation about setting up phpunit, in the part where it mentions changes to config.php so people can't really miss it in future...

          http://docs.moodle.org/dev/PHPUnit#Initialisation_of_test_environment

          Show
          Sam Marshall added a comment - Adrian: The proxy issue initially caused me trouble as well. To ensure this is clear, I have added it to the documentation about setting up phpunit, in the part where it mentions changes to config.php so people can't really miss it in future... http://docs.moodle.org/dev/PHPUnit#Initialisation_of_test_environment
          Hide
          Eloy Lafuente (stronk7) added a comment -

          UPDATE tracker_issues
             SET status = 'Closed',
                comment = 'Thanks!'
          WHEN participants = 'Did a gorgeous work'
          

          This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

          Show
          Eloy Lafuente (stronk7) added a comment - UPDATE tracker_issues SET status = 'Closed', comment = 'Thanks!' WHEN participants = 'Did a gorgeous work' This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

            People

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

              Dates

              • Created:
                Updated:
                Resolved: