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

H5P PHPUnit test fixes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: H5P
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. In terminal run "php admin/tool/phpunit/cli/init.php" from the pathroot of your Moodlesite installation.

      Testing scenario 1. LONGTEST skipped

      1. In terminal run "./vendor/bin/phpunit h5p/tests/framework_test.php"
        • Make sure 3 tests are being skipped (test_fetchExternalData_no_path_defined, test_fetchExternalData_path_defined, test_fetchExternalData_url_not_h5p)
          because PHPUNIT_LONGTEST is not defined

      Testing scenario 2. All tests executed

      1. In config.php add:

      define('PHPUNIT_LONGTEST', true);

      # In the terminal run "./vendor/bin/phpunit h5p/tests/framework_test.php"

        • Make sure all test are being successfully executed.
      1. In the terminal run "./vendor/bin/phpunit h5p/tests/generator_test.php"
        • Make sure all test are being successfully executed.
      2. In the terminal run "./vendor/bin/phpunit h5p/tests/h5p_file_storage_test.php"
        • Make sure all test are being successfully executed.
      Show
      Setup In terminal run "php admin/tool/phpunit/cli/init.php" from the pathroot of your Moodlesite installation. Testing scenario 1. LONGTEST skipped In terminal run " ./vendor/bin/phpunit h5p/tests/framework_test.php" Make sure 3 tests are being skipped (test_fetchExternalData_no_path_defined, test_fetchExternalData_path_defined, test_fetchExternalData_url_not_h5p) because PHPUNIT_LONGTEST is not defined Testing scenario 2. All tests executed In config.php add: define( 'PHPUNIT_LONGTEST' , true ); # In the terminal run " ./vendor/bin/phpunit h5p/tests/framework_test.php" Make sure all test are being successfully executed. In the terminal run " ./vendor/bin/phpunit h5p/tests/generator_test.php" Make sure all test are being successfully executed. In the terminal run " ./vendor/bin/phpunit h5p/tests/h5p_file_storage_test.php" Make sure all test are being successfully executed.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-67158-master
    • Sprint:
      H5P Sprint Relase 3.8

      Description

      Some things which I've come across and which need fixing.

      PHPUNIT_LONGTEST required in framework tests which call download_file_content:

      1. test_fetchExternalData_no_path_defined and friends

      runTestsInSeparateProcess required for all tests which include the H5P libraries.
      This is because they will load libraries which can conflict with a known third-party library and will either cause that plugin's tests to fail, or will fail because of that plugin at some point in the future.

        Attachments

          Activity

            People

            Assignee:
            Geshoski Mihail Geshoski
            Reporter:
            dobedobedoh Andrew Nicols
            Peer reviewer:
            Carlos Escobedo
            Integrator:
            Sara Arjona (@sarjona)
            Tester:
            Gladys Basiana
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

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

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h