Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#15029 closed (fixed)

Delegate to DB backends the task of detecting when different DATABASES item values point to different RDBMS test DBs

Reported by: Ramiro Morales Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In r14696/r14822 we fixed the ability to detect and handle without data loss database definitions that point to the same RDBMS database when setting up/tearing down tests.

The tuple of values used to distinguish among them contains (HOST, PORT ENGINE, NAME). In Oracle test setup all these values can be identical among two DATABASES item values but still point to different databases (actually tablespaces, in the Oracle nomenclature), even further, they usually will be the same when using a single Oracle installation. Shai also hinted about MS SQL possible needing more variables in the mix for similar reasons.

The patch attached to this ticket moves that to a method of BaseDatabaseCreation so it can be customized by the backends that need this. This reduces again the number of test suite failures happening in Oracle (currently, tests that assume the default and other databases are mutually isolated do fail.)

Attachments (2)

15029.diff (6.3 KB ) - added by Ramiro Morales 14 years ago.
15029.2.diff (6.4 KB ) - added by Ramiro Morales 14 years ago.
Patch modified with change suggested by Ian

Download all attachments as: .zip

Change History (8)

by Ramiro Morales, 14 years ago

Attachment: 15029.diff added

comment:1 by Ramiro Morales, 14 years ago

Summary: Delegate to DB backends the task of when two DATABASES item values point to different RDBMS test DBsDelegate to DB backends the task of detecting when different DATABASES item values point to different RDBMS test DBs

comment:2 by Russell Keith-Magee, 14 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Erin Kelly, 14 years ago

I tested the patch out with Oracle. It corrected 2000 errors and did not appear to be causing any new failures.

I suggest though that the Oracle backend should differentiate on TEST_USER rather than TEST_TBLSPACE. That we require TEST_TBLSPACE to be different is an implementation detail, and in fact it's probably possible to configure a test settings module that uses the same tablespace for both connections by disabling the TEST_CREATE option. The necessary distinction is that the connections are made to different schemas, as indicated by TEST_USER.

by Ramiro Morales, 14 years ago

Attachment: 15029.2.diff added

Patch modified with change suggested by Ian

comment:4 by Ramiro Morales, 14 years ago

Resolution: fixed
Status: newclosed

In [15392]:

Fixed #15029 -- Moved to database backends the ability to decide if two DATABASES items are different when creating temporary databases for tests.
hG: Enter commit message. Lines beginning with 'HG:' are removed.

comment:5 by Ramiro Morales, 14 years ago

In [15395]:

[1.2.X] Fixed #15029 -- Moved to database backends the ability to decide if two DATABASES items are different when creating temporary databases for tests.

Backport of [15392] from trunk

comment:6 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top