Moodle

Complete coverage of DDL/DML tests

Details

  • Type: Task Task
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Difficulty:
    Moderate
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Review current DDL/DML tests, filling missing ones and completing them to cover all the stuff and cases.

Some things to review:

testing insert/update/set_field nulls, insert/update/set_field string data in numeric fields, insert/update/set_field boolean data into numeric/varchar/text fields, select/insert/update/set_fieldempty varchar and text fields, lowercase fieldnames, defaults... functions without params... sql_helper() functions..., limits when fetching records, all the get_columns() information, returned id on insert, get_indexes (with some column named, "time" because of PG internals).

  1. all_db_bitwise.patch.txt
    06/Sep/10 11:51 PM
    5 kB
    Eloy Lafuente (stronk7)
  2. MOODLE_ORACLE_PACKAGE.sql
    06/Sep/10 10:27 PM
    4 kB
    Eloy Lafuente (stronk7)

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

table related methods coverage completed. Committing because I need all the changes in CVS before computer switch tomorrow.

Show
Eloy Lafuente (stronk7) added a comment - table related methods coverage completed. Committing because I need all the changes in CVS before computer switch tomorrow.
Hide
Eloy Lafuente (stronk7) added a comment -

add/drop field and change_field_type() completed. More coming.

Show
Eloy Lafuente (stronk7) added a comment - add/drop field and change_field_type() completed. More coming.
Hide
Eloy Lafuente (stronk7) added a comment -

Wow, just discovered a bunch of missing bits when working in MDL-17969. Expect more and more tests soon!

Show
Eloy Lafuente (stronk7) added a comment - Wow, just discovered a bunch of missing bits when working in MDL-17969. Expect more and more tests soon!
Hide
Petr Škoda (skodak) added a comment -

hopefully we have enough tests now, we are going to add more tests if ppl report problems, yay!

thanks a lot!

Show
Petr Škoda (skodak) added a comment - hopefully we have enough tests now, we are going to add more tests if ppl report problems, yay! thanks a lot!
Hide
Eloy Lafuente (stronk7) added a comment -

Hi, just to comment I've this in my TODO since ages ago (when I reviewed existing tests 1 year ago) related to this bug:

  • MDL-19057: Look (and create) some tests: lowercase fieldnames, defaults... functions without params... sql_helper() functions... all tested with nulls, 0, empty, numeric. column names and placeholders mixs, all the get_columns() information, returned id on insert, get_indexes (with some column named, "time" because of PG internals), try nested recordsets. Review what's missing. Test count() functions having NULL values. VM with 4 DBs to run tests periodically. In DDL tests, check creation of > 1 auto-numeric column, test creation of auto-numeric nor being PK, all them must return ddl exception. import_record() test null/empty/0/clob/blob (exactly like insert_record. right now it's failing for sure under PG and others potentially)

Just to consider if we should create a new bug to continue adding them (surely after 2.0). Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi, just to comment I've this in my TODO since ages ago (when I reviewed existing tests 1 year ago) related to this bug:
  • MDL-19057: Look (and create) some tests: lowercase fieldnames, defaults... functions without params... sql_helper() functions... all tested with nulls, 0, empty, numeric. column names and placeholders mixs, all the get_columns() information, returned id on insert, get_indexes (with some column named, "time" because of PG internals), try nested recordsets. Review what's missing. Test count() functions having NULL values. VM with 4 DBs to run tests periodically. In DDL tests, check creation of > 1 auto-numeric column, test creation of auto-numeric nor being PK, all them must return ddl exception. import_record() test null/empty/0/clob/blob (exactly like insert_record. right now it's failing for sure under PG and others potentially)
Just to consider if we should create a new bug to continue adding them (surely after 2.0). Ciao
Hide
Petr Škoda (skodak) added a comment -

reopening and moving out from the meta bug for now, thanks for the info, I will try to add more tests soon

Show
Petr Škoda (skodak) added a comment - reopening and moving out from the meta bug for now, thanks for the info, I will try to add more tests soon
Hide
Eloy Lafuente (stronk7) added a comment -

Uhm... just saw you are adding more and more tests... perhaps we should add these changes to have correct bitwise operations under Oracle (will break under MSSQL, I bet)

Attaching patches... ciao

Show
Eloy Lafuente (stronk7) added a comment - Uhm... just saw you are adding more and more tests... perhaps we should add these changes to have correct bitwise operations under Oracle (will break under MSSQL, I bet) Attaching patches... ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Wow, just saw that MSSQL also supports the standard "^" operator for bitwise XOR, so we don't need it doing the bool in PHP anymore.

Also PG has one operator "#" for that, so we don't need algebra (leading to problems in placeholders) anymore.

Yay!

Attaching candidate patch to all the native drivers. It just needs more tests

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Wow, just saw that MSSQL also supports the standard "^" operator for bitwise XOR, so we don't need it doing the bool in PHP anymore. Also PG has one operator "#" for that, so we don't need algebra (leading to problems in placeholders) anymore. Yay! Attaching candidate patch to all the native drivers. It just needs more tests Ciao
Hide
Petr Škoda (skodak) added a comment -

yay!

Show
Petr Škoda (skodak) added a comment - yay!
Hide
Petr Škoda (skodak) added a comment -

Should be finished now, the tests are failing for on MSSQL and Oracle, I have created separate issues for these...
Thanks a lot for cooperation.

Ciao!

Show
Petr Škoda (skodak) added a comment - Should be finished now, the tests are failing for on MSSQL and Oracle, I have created separate issues for these... Thanks a lot for cooperation. Ciao!

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: