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

PHPUnit: Put debugging messages with the error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.8.9, 2.9.4, 3.0.2
    • Unit tests
    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Hide

      Add a debugging() call to any test and run that test or test suite. After the fix, the debugging message should be reported with the test in the PHPUnit report.

      Show
      Add a debugging() call to any test and run that test or test suite. After the fix, the debugging message should be reported with the test in the PHPUnit report.

      Currently, when there is a debugging message emitted during a test, the debugging message is printed to the screen and then a separate message is sent via trigger_error to fail the test. The debugging message(s) should be included with the message for trigger_error as it helps with several things:

      • Debugging messages are no longer printed in the PHPUnit progress bar (at least if it happens during a test).
      • The debugging message is actually associated to the test in the PHPUnit report. This works for the text format or for JUnit format which is used on CI. Without this, you cannot tell which debugging message goes with which test and you must look at the logs for the message itself. This helps a lot with CI builds.

            Unassigned Unassigned
            bushido Mark Nielsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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