Moodle

FakeDBUnitTestCase and UnitTestCaseUsingDatabase are being silently skipped

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Unit tests
  • Labels:
    None
  • Difficulty:
    Moderate
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Since some months ago we have "old" FakeDBUnitTestCase disabled. Also UnitTestCaseUsingDatabase aren't executed if test-prefix isn't set.

That leads to a bunch of tests of those types not being performed without further notification.

Is it possible to add debugging/notification or whatever there, both to FakeDBUnitTestCase and UnitTestCaseUsingDatabase, in order to get some visual feedbak about each skipped test? Something like:

  • FakeDBUnitTestCase: deprecated, needs conversion to UnitTestCaseUsingDatabase
  • UnitTestCaseUsingDatabase: skipped, set the testprefix

Right now it's skipping way too much (portfolio, completion...) to be acceptable.

Ciao

Issue Links

Activity

Hide
Tim Hunt added a comment -

Good idea. I agree in principle, but I don't have time to do anything about it.

Show
Tim Hunt added a comment - Good idea. I agree in principle, but I don't have time to do anything about it.
Hide
Eloy Lafuente (stronk7) added a comment -

Just tried to enable UnitTestCaseUsingDatabase (by setting $CFG->unittestprefix) and discovered a bunch of exceptions related with inserting negative depths (-1) into context table. All them in the testpagelib_moodlepage unit test. So I've changed all those -1 to 13 to allow tests to run.

Show
Eloy Lafuente (stronk7) added a comment - Just tried to enable UnitTestCaseUsingDatabase (by setting $CFG->unittestprefix) and discovered a bunch of exceptions related with inserting negative depths (-1) into context table. All them in the testpagelib_moodlepage unit test. So I've changed all those -1 to 13 to allow tests to run.
Hide
Eloy Lafuente (stronk7) added a comment - - edited

Also added "log" to $extensions_to_ignore to avoid any test over oracle sqlnet log files. (in testcode.php)

Show
Eloy Lafuente (stronk7) added a comment - - edited Also added "log" to $extensions_to_ignore to avoid any test over oracle sqlnet log files. (in testcode.php)
Hide
Eloy Lafuente (stronk7) added a comment -

Fixed blog tests to use testing DB by creating all the needed stuff (course, groups, contexts). This can be a pain if there are very complex structures to create and tons of records to insert. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Fixed blog tests to use testing DB by creating all the needed stuff (course, groups, contexts). This can be a pain if there are very complex structures to create and tons of records to insert. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Anyway, going to work in the goal of this bug: Warn about some tests not being executed:

  • FakeDBUnitTestCase because they are deprecated and need conversion to UnitTestCaseUsingDatabase
  • UnitTestCaseUsingDatabase not being executed if $CFG->unittestprefix is not set
Show
Eloy Lafuente (stronk7) added a comment - Anyway, going to work in the goal of this bug: Warn about some tests not being executed:
  • FakeDBUnitTestCase because they are deprecated and need conversion to UnitTestCaseUsingDatabase
  • UnitTestCaseUsingDatabase not being executed if $CFG->unittestprefix is not set
Hide
Eloy Lafuente (stronk7) added a comment -

Done:

  • FakeDBUnitTestCase are reported and count as exceptions (must be fixed) moving them to UnitTestCaseUsingDatabase.
  • UnitTestCaseUsingDatabase are skipped and not counted but message is displayed to know they are there.

Resolving as fixed, ciao

Show
Eloy Lafuente (stronk7) added a comment - Done:
  • FakeDBUnitTestCase are reported and count as exceptions (must be fixed) moving them to UnitTestCaseUsingDatabase.
  • UnitTestCaseUsingDatabase are skipped and not counted but message is displayed to know they are there.
Resolving as fixed, ciao

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: