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

Remove old (simpletest) includecoverage and excludecoverage cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.11.6
    • 3.11.5, 4.0
    • Questions, Unit tests
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE
    • Hide

      Assuming that to generate a complete coverage report is not worth the effort, neither to run them individually, because coverage is really light (this developer has run it for all the modified unit tests).

      So, just:

      1. Run grep -lr 'includecoverage|excludecoverage'
      2. Verify that there aren't remaining cases in core.
      3. That's all!
      Show
      Assuming that to generate a complete coverage report is not worth the effort, neither to run them individually, because coverage is really light (this developer has run it for all the modified unit tests). So, just: Run grep -lr 'includecoverage|excludecoverage' Verify that there aren't remaining cases in core. That's all!

      Before Moodle 2.3 we used SimpleTest instead of PHPUnit test.

      It had its own way to specify code coverage and was about to add some static members to the unit test case classes:

      public  static $includecoverage = array('lib/dml');
      public  static $excludecoverage = array('lib/dml/somedir');
      

      When we moved to PHPUnit, that uses its own code coverage annotations and include/exclude coverage definitions, a few of those old members were not removed from core.

      This issue is about:

      1. Remove remaining ones from core.
      2. If needed (not yet being applied) find their PHPUnit alternatives.

      This is the current list of remaining cases:

      $ ag 'includecoverage|excludecoverage'
      question/type/numerical/tests/questiontype_test.php
      42:    public static $includecoverage = array(
       
      question/type/tests/questiontype_test.php
      40:    public static $includecoverage = array('question/type/questiontypebase.php');
       
      question/type/shortanswer/tests/questiontype_test.php
      41:    public static $includecoverage = array(
       
      question/type/calculated/tests/questiontype_test.php
      40:    public static $includecoverage = array(
       
      question/type/calculatedsimple/tests/questiontype_test.php
      42:    public static $includecoverage = array(
       
      lib/tests/moodlelib_test.php
      31:    public static $includecoverage = array('lib/moodlelib.php');
       
      mod/quiz/accessrule/securewindow/tests/rule_test.php
      40:    public static $includecoverage = array('mod/quiz/accessrule/securewindow/rule.php');
      

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 55 minutes
                55m

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