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

Errors when running h5p_core_test.php unit test isolated

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80653-401
    • MDL-80653-403
    • Hide
      1. Add the following to your site config.php file:

        define('PHPUNIT_LONGTEST', true);
        

      2. Init PHPUnit:

        php admin/tool/phpunit/cli/init.php

      3. Execute the following test:

        $ vendor/bin/phpunit --testsuite core_h5p_testsuite
        

      4. Confirm the tests pass
      5. Download 80653.diff and apply the test patch (to ensure failure):

        $ git apply /path/to/80653.diff
        

      6. Run the same testsuite as in step 2
      7. Confirm you get the following failure on twice:

        Invalid response value detected (No information could be obtained on the H5P content types available. H5P repository connection failure)
        

      Show
      Add the following to your site config.php file: define('PHPUNIT_LONGTEST', true); Init PHPUnit: php admin/tool/phpunit/cli/init.php Execute the following test: $ vendor/bin/phpunit --testsuite core_h5p_testsuite Confirm the tests pass Download 80653.diff and apply the test patch (to ensure failure): $ git apply /path/to/80653.diff Run the same testsuite as in step 2 Confirm you get the following failure on twice: Invalid response value detected (No information could be obtained on the H5P content types available. H5P repository connection failure)

      While CL reviewing MDL-80591 I have noticed a couple of errors when running phpunit on h5p_core_test.php:

      $ vendor/bin/phpunit h5p/tests/h5p_core_test.php
      Moodle 4.4dev (Build: 20240112), 05d56ddc7564d4e91dfb8fcb324c1448eef61b95
      Php: 8.1.27, pgsql: 14.10 (Ubuntu 14.10-0ubuntu0.22.04.1), OS: Linux 5.15.0-91-generic x86_64
      PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
       
      EE..                                                                4 / 4 (100%)
       
      Time: 00:06.469, Memory: 60.50 MB
       
      There were 2 errors:
       
      1) core_h5p\h5p_core_test::test_fetch_content_type
      Undefined property: stdClass::$contentTypes
       
      /home/simey/moodles/stable_master/moodle/h5p/tests/h5p_core_test.php:73
      /home/simey/moodles/stable_master/moodle/lib/phpunit/classes/advanced_testcase.php:69
       
      2) core_h5p\h5p_core_test::test_fetch_latest_content_types
      invalid_response_exception: Invalid response value detected (No information could be obtained on the H5P content types available. H5P repository connection failure)
      

      /home/simey/moodles/stable_master/moodle/h5p/tests/generator/lib.php:414
      /home/simey/moodles/stable_master/moodle/h5p/tests/h5p_core_test.php:142
      /home/simey/moodles/stable_master/moodle/lib/phpunit/classes/advanced_testcase.php:69

        1. 80653.diff
          0.6 kB
        2. MDL-80653.png
          MDL-80653.png
          160 kB

            pholden Paul Holden
            lameze Simey Lameze
            Angelia Dela Cruz Angelia Dela Cruz
            Simey Lameze Simey Lameze
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 57 minutes
                6h 57m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.