I'm -0, on sweeping this explosion of settings (mostly for Oracle) under a
"TEST" rug, instead of addressing the underlying problem. The entire TEST_*
collection of settings is, in my opinion, a broken design that is used to
shim a second "test" database configuration in a spot designed for a single
database configuration.

Why are we not encouraging people to define different aliases for testing?
Many of those TEST_ settings could be given meaning to the database
configuration without being specific to running tests. Several of those
TEST_ settings would no longer be necessary and several more would be
properly rooted under OPTIONS because they are specific to a database's
connection.

The only real benefit I see from the current implementation is that
TEST_NAME defaults to a prefixed name that should help reduce the chance of
mangling a production database. I'd rather see a top level TEST_DATABASES
or a IS_TEST_DATABASE (default False) key added to maintain that small
amount of configuration safety.

Regards,
Michael Manfre


On Tue, Jan 14, 2014 at 12:04 PM, Shai Berger <s...@platonix.com> wrote:

> Hi all,
>
> Django's database settings currently support eleven separate parameters for
> testing, all named 'TEST_*', most of them more-or-less backend-specific (in
> fact, six -- already a majority -- are Oracle-specific). We have now
> discovered[1] that we need even more Oracle-test-specific parameters, for
> better control of the creation of the test tablespaces; I suppose there
> could
> be parallels for those in the other backends (for creation of test
> databases,
> the similar-but-not-equivalent feature).
>
> In my opinion, this is beginning to smell; I'd like to collect all these
> parameters into their own sub-dictionary, perhaps named "TESTING"; this
> is, of
> course, not backwards-compatible, and I'd like to hear your opinions. An
> alternative is to do something just for Oracle, but that would be a little
> odd
> IMO.
>
> The settings that may be affected are:
>
>         Non-backend-specific:
>
>                 TEST_DEPENDENCIES
>                 TEST_MIRROR
>
>         Different semantics on different backends:
>
>                 TEST_NAME[2]
>
>         MySQL:
>
>                 TEST_CHARSET[3]
>                 TEST_COLLATION
>
>         PostgreSQL:
>
>                 TEST_CHARSET[3]
>
>         Oracle:
>
>                 TEST_USER_CREATE
>                 TEST_USER
>                 TEST_PASSWD
>                 TEST_CREATE
>                 TEST_TBLSPACE
>                 TEST_TBLSPACE_TMP
>
> For the curious-but-lazy, the Oracle settings are needed because Oracle
> does
> not do "databases" like other backends do, and so the testing framework
> needs
> a test user and a test tablespace; the TEST_{USER_,}CREATE settigns are
> booleans that control if these will be created for the test or just used.
> The
> parameters I want to add now, following #21775[1], would specify the exact
> location for the test tablespace files, and their initial and maximum
> sizes.
>
> Opinions?
>
> Thanks,
>         Shai.
>
> [1] https://code.djangoproject.com/ticket/21775
>
> [2] On SQLite, the defualt is to use in-memory database (":memory:"), on
> others ('test_' + name); on Oracle the setting is used only for reporting
> to
> the user, and has no effect on the database used.
>
> [3] The name TEST_CHARSET is common to MySQL and PostgreSQL, but the
> appropriate values are backend-specific.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/201401141904.43630.shai%40platonix.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAGdCwBvJGSgOExDac5P511gqPgg6FPTt654gjNptqkCqC-2faA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to