diff options
author | Emily O'Leary <Emma.C.Echo@gmail.com> | 2013-06-25 20:57:50 -0400 |
---|---|---|
committer | Emily O'Leary <Emma.C.Echo@gmail.com> | 2013-06-25 20:57:50 -0400 |
commit | 4a698535bc97b37c8eb42ffea2cc3e7bd48565e6 (patch) | |
tree | 5ee573acc9f8c91cb53e44a1ee55529f3c74e5e1 /mediagoblin/tests | |
parent | c1b342ba95e99407ccedfdfad306ddb36fde6eb0 (diff) | |
download | mediagoblin-4a698535bc97b37c8eb42ffea2cc3e7bd48565e6.tar.lz mediagoblin-4a698535bc97b37c8eb42ffea2cc3e7bd48565e6.tar.xz mediagoblin-4a698535bc97b37c8eb42ffea2cc3e7bd48565e6.zip |
Improved test runtime from 352 seconds to 59 seconds by implementing an in-memory sqlite DB and including an option to run migrations on this newly created database by adding a config option called run_migrations to the config_spec and passing it along in app.py to the setup_database function.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r-- | mediagoblin/tests/appconfig_context_modified.ini | 5 | ||||
-rw-r--r-- | mediagoblin/tests/appconfig_static_plugin.ini | 5 | ||||
-rw-r--r-- | mediagoblin/tests/test_mgoblin_app.ini | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/mediagoblin/tests/appconfig_context_modified.ini b/mediagoblin/tests/appconfig_context_modified.ini index 80ca69b1..cc6721f5 100644 --- a/mediagoblin/tests/appconfig_context_modified.ini +++ b/mediagoblin/tests/appconfig_context_modified.ini @@ -3,8 +3,9 @@ direct_remote_path = /test_static/ email_sender_address = "notice@mediagoblin.example.org" email_debug_mode = true -# TODO: Switch to using an in-memory database -sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db" +#Runs with an in-memory sqlite db for speed. +sql_engine = "sqlite://" +run_migrations = true # Celery shouldn't be set up by the application as it's setup via # mediagoblin.init.celery.from_celery diff --git a/mediagoblin/tests/appconfig_static_plugin.ini b/mediagoblin/tests/appconfig_static_plugin.ini index dc251171..5ce5c5bd 100644 --- a/mediagoblin/tests/appconfig_static_plugin.ini +++ b/mediagoblin/tests/appconfig_static_plugin.ini @@ -3,8 +3,9 @@ direct_remote_path = /test_static/ email_sender_address = "notice@mediagoblin.example.org" email_debug_mode = true -# TODO: Switch to using an in-memory database -sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db" +#Runs with an in-memory sqlite db for speed. +sql_engine = "sqlite://" +run_migrations = true # Celery shouldn't be set up by the application as it's setup via # mediagoblin.init.celery.from_celery diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini index 0466b53b..78905e33 100644 --- a/mediagoblin/tests/test_mgoblin_app.ini +++ b/mediagoblin/tests/test_mgoblin_app.ini @@ -3,8 +3,9 @@ direct_remote_path = /test_static/ email_sender_address = "notice@mediagoblin.example.org" email_debug_mode = true -# TODO: Switch to using an in-memory database -sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db" +#Runs with an in-memory sqlite db for speed. +sql_engine = "sqlite://" +run_migrations = true # tag parsing tags_max_length = 50 |