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

Allow phpunit tests to use local external files or skip external tests completely

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      0/ run phpunit tests
      1/ checkout https://github.com/moodlehq/moodle-exttests to your web server
      2/ alter your config.php to include following or hack phpunit.xml file:

      define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost/exttests');
      

      3/ run phpunittests
      4/ set TEST_EXTERNAL_FILES_HTTP_URL to false
      5/ verify tests are skipped

      Show
      0/ run phpunit tests 1/ checkout https://github.com/moodlehq/moodle-exttests to your web server 2/ alter your config.php to include following or hack phpunit.xml file: define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost/exttests'); 3/ run phpunittests 4/ set TEST_EXTERNAL_FILES_HTTP_URL to false 5/ verify tests are skipped
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w40_MDL-41707_m26_exttests
    • Story Points:
      4
    • Sprint:
      BACKEND Sprint 5

      Description

      Currently Unit tests require access to external servers. Unit tests can fail when you don't have sufficient access to the internet or when certain services are down. If tinyurl or download.moodle.org are not operating correctly then unit tests fail.

      This is not always the desired behaviour for others completing unit testing. So we want to add an option to exclude tests from being executed when they are remote.

      By default we will continue with the current external runs to ensure we don't change the current expected behaviour.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              mr-russ Russell Smith
              Peer reviewer:
              Dan Poltawski
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13