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

unit test failures in question code after upstream dependency updated

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Hide

      Automatic (still using old PHPUnit versions).

      • Verify that CIs (ToBiC comment in this issue) continue passing.
      • Verify that the GHA badges in this issue (near the branches information @ the top) continue passing.

      Manual (forcing newer PHPUnit versions to be used).

      • Note 1: Following numbered steps need to be repeated for the 4 branches (39, 311, 400 and master).
      • Note 2: Use PHP 7.4 for all them (to avoid having to switch of PHP versions).

      Testing steps

      1. Delete the composer.lock file and the vendor directory completely: rm -fr composer.lock vendor
      2. Init PHPUnit: php admin/tool/phpunit/cli/init.php
      3. Verify that you see the following in the output:
        1. For 39_STABLE:
          1. phpunit/phpunit (7.5.20) as part of the process. It's important the "20" (that is the minimum to see the problem, so 21, 22... are ok too).
          2. sebastian/comparator (3.0.5) (or later).
        2. For the other branches:
          1. phpunit/phpunit (9.5.24) as part of the process. t's important the "24" (that is the minimum to see the problem, so 25, 26... are ok too).
          2. sebastian/comparator (4.0.8) (or later).
      4. Run this test: vendor/bin/phpunit question/type/multianswer/tests/question_test.php
      5. Verify it ends without errors.
      6. Run this test:
        1. For 39_STABLE: vendor/bin/phpunit question/behaviour/deferredcbm/tests/behaviourtype_test.php
        2. Fo the other branches: vendor/bin/phpunit question/behaviour/deferredcbm/tests/behaviour_type_test.php
      7. Verify it ends without errors.
      Show
      Automatic (still using old PHPUnit versions). Verify that CIs (ToBiC comment in this issue) continue passing. Verify that the GHA badges in this issue (near the branches information @ the top) continue passing. Manual (forcing newer PHPUnit versions to be used). Note 1: Following numbered steps need to be repeated for the 4 branches (39, 311, 400 and master). Note 2: Use PHP 7.4 for all them (to avoid having to switch of PHP versions). Testing steps Delete the composer.lock file and the vendor directory completely: rm -fr composer.lock vendor Init PHPUnit: php admin/tool/phpunit/cli/init.php Verify that you see the following in the output: For 39_STABLE: phpunit/phpunit (7.5.20) as part of the process. It's important the "20" (that is the minimum to see the problem, so 21, 22... are ok too). sebastian/comparator (3.0.5) (or later). For the other branches: phpunit/phpunit (9.5.24) as part of the process. t's important the "24" (that is the minimum to see the problem, so 25, 26... are ok too). sebastian/comparator (4.0.8) (or later). Run this test: vendor/bin/phpunit question/type/multianswer/tests/question_test.php Verify it ends without errors. Run this test: For 39_STABLE: vendor/bin/phpunit question/behaviour/deferredcbm/tests/behaviourtype_test.php Fo the other branches: vendor/bin/phpunit question/behaviour/deferredcbm/tests/behaviour_type_test.php Verify it ends without errors.

      Stuff like:
       
      qbehaviour_deferredcbm_type_test::test_calculate_bonus
      Failed asserting that -0.010000000000000054 matches expected -0.01.
      question/behaviour/deferredcbm/tests/behaviourtype_test.php:148
       
       qtype_multianswer_question_test::test_compute_final_grade
      Failed asserting that 0.7333333333333334 matches expected 0.7333333333333333.
      question/type/multianswer/tests/question_test.php:211
      2) qbehaviour_deferredcbm_type_test::test_calculate_bonus
      Failed asserting that -0.010000000000000054 matches expected -0.01.
      question/behaviour/deferredcbm/tests/behaviourtype_test.php:149
      Appears to be caused by the change here:
      https://github.com/sebastianbergmann/comparator/pull/102
       
      But - those tests should be tidied up so that they don't depend on rounding for assertEquals to work.

        1. MDL-75757_master.png
          MDL-75757_master.png
          220 kB
        2. MDL-75757_v311.png
          MDL-75757_v311.png
          218 kB
        3. MDL-75757_v39.png
          MDL-75757_v39.png
          224 kB
        4. MDL-75757_v400.png
          MDL-75757_v400.png
          222 kB

            stronk7 Eloy Lafuente (stronk7)
            danmarsden Dan Marsden
            Tim Hunt Tim Hunt
            Jun Pataleta Jun Pataleta
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 10 minutes
                4h 10m

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