From 3efaf91c51df9e69914b17a89a2d417446db0c61 Mon Sep 17 00:00:00 2001 From: K Lars Lohn Date: Thu, 12 Dec 2013 09:06:52 -0800 Subject: [PATCH 1/2] changed to configman 1.1.14 --- requirements/prod.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/prod.txt b/requirements/prod.txt index 612df80724..bab00be363 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -1,5 +1,5 @@ -# sha256: sVa-wgD9NyieZIiXTeBQcqkQPs9tkQ_dN3IsHaM2vHU -configman==1.1.12 +# sha256: WlJmfb-DmZS_IHA8aMM0jsRDchM2FtLoome-36unEEQ +configman==1.1.14 # sha256: UV_5I0YlkugyHfi0jEfjQo-NQG7iK43ne--WnRrxEXE configobj==4.7.2 # sha256: oz42dZy6Gowxw8AelDtO4gRgTW_xPdooH484k7I5EOY From 5985229ff2456f876a8c6e5606f28876443f91c8 Mon Sep 17 00:00:00 2001 From: K Lars Lohn Date: Thu, 12 Dec 2013 10:44:49 -0800 Subject: [PATCH 2/2] fixed unit tests so configman ignores command line switches given to nose. --- socorro/unittest/cron/base.py | 3 ++- .../cron/jobs/test_automatic_emails.py | 9 ++++--- .../unittest/cron/jobs/test_cleanup_radix.py | 3 ++- socorro/unittest/cron/test_crontabber.py | 1 + .../database/test_transaction_executor.py | 6 +++++ .../elasticsearch/test_crashstorage.py | 15 +++++++---- .../external/elasticsearch/test_search.py | 3 ++- .../elasticsearch/test_supersearch.py | 3 ++- .../external/elasticsearch/unittestbase.py | 3 ++- .../external/filesystem/test_crash_data.py | 3 ++- .../external/filesystem/test_crashstorage.py | 3 ++- .../fs/test_fsdatedradixtreestorage.py | 3 ++- .../fs/test_fslegacydatedradixtreestorage.py | 3 ++- .../external/fs/test_fsradixtreestorage.py | 3 ++- .../external/hbase/test_crash_data.py | 3 ++- .../external/hbase/test_crashstorage.py | 9 ++++--- .../external/postgresql/test_crashstorage.py | 21 ++++++++++----- .../external/postgresql/test_setupdb_app.py | 3 ++- .../external/postgresql/unittestbase.py | 3 ++- .../external/test_crashstorage_base.py | 15 ++++++++--- socorro/unittest/lib/test_search_common.py | 1 + .../middleware/test_middleware_app.py | 3 ++- .../processor/test_registration_client.py | 27 ++++++++++++------- 23 files changed, 102 insertions(+), 44 deletions(-) diff --git a/socorro/unittest/cron/base.py b/socorro/unittest/cron/base.py index aa3b301aac..28f5a6d292 100644 --- a/socorro/unittest/cron/base.py +++ b/socorro/unittest/cron/base.py @@ -85,7 +85,8 @@ def _setup_config_manager(self, jobs_string, extra_value_source=None): ], values_source_list=value_source, app_name='crontabber', - app_description=__doc__ + app_description=__doc__, + argv_source=[] ) return config_manager diff --git a/socorro/unittest/cron/jobs/test_automatic_emails.py b/socorro/unittest/cron/jobs/test_automatic_emails.py index 0fd4b7381f..94322bd800 100644 --- a/socorro/unittest/cron/jobs/test_automatic_emails.py +++ b/socorro/unittest/cron/jobs/test_automatic_emails.py @@ -27,7 +27,8 @@ def _setup_simple_config(self, domains=None): [conf], values_source_list=[{ 'common_email_domains': domains, - }] + }], + argv_source=[] ) def test_correct_email(self): @@ -338,7 +339,8 @@ def _setup_simple_config(self, common_email_domains=None): values_source_list['common_email_domains'] = common_email_domains return ConfigurationManager( [conf], - values_source_list=[values_source_list] + values_source_list=[values_source_list], + argv_source=[] ) def _setup_test_mode_config(self): @@ -354,7 +356,8 @@ def _setup_test_mode_config(self): 'restrict_products': ['WaterWolf'], 'test_mode': True, 'email_template': 'socorro_dev_test' - }] + }], + argv_source=[] ) @mock.patch('socorro.external.exacttarget.exacttarget.ExactTarget') diff --git a/socorro/unittest/cron/jobs/test_cleanup_radix.py b/socorro/unittest/cron/jobs/test_cleanup_radix.py index 5a82dd726e..0b35741866 100644 --- a/socorro/unittest/cron/jobs/test_cleanup_radix.py +++ b/socorro/unittest/cron/jobs/test_cleanup_radix.py @@ -48,7 +48,8 @@ def _setup_radix_storage(self): 'logger': mock_logging, 'minute_slice_interval': 1, 'fs_root': self.temp_fs_root - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/cron/test_crontabber.py b/socorro/unittest/cron/test_crontabber.py index 353fb2cfbd..81f671209f 100644 --- a/socorro/unittest/cron/test_crontabber.py +++ b/socorro/unittest/cron/test_crontabber.py @@ -138,6 +138,7 @@ def setUp(self): ], values_source_list=[DSN], app_name='crontabber', + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/database/test_transaction_executor.py b/socorro/unittest/database/test_transaction_executor.py index 20797ffe36..48c85dcd32 100644 --- a/socorro/unittest/database/test_transaction_executor.py +++ b/socorro/unittest/database/test_transaction_executor.py @@ -96,6 +96,7 @@ def test_basic_usage_with_postgres(self): app_version='1.0', app_description='app description', values_source_list=[], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) @@ -134,6 +135,7 @@ def test_rollback_transaction_exceptions_with_postgres(self): app_version='1.0', app_description='app description', values_source_list=[], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) @@ -172,6 +174,7 @@ def test_basic_usage_with_postgres_with_backoff(self): app_version='1.0', app_description='app description', values_source_list=[], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) @@ -211,6 +214,7 @@ def test_operation_error_with_postgres_with_backoff(self): app_version='1.0', app_description='app description', values_source_list=[{'backoff_delays': [2, 4, 6, 10, 15]}], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) @@ -271,6 +275,7 @@ def test_operation_error_with_postgres_with_backoff_with_rollback(self): app_version='1.0', app_description='app description', values_source_list=[{'backoff_delays': [2, 4, 6, 10, 15]}], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) @@ -332,6 +337,7 @@ def test_programming_error_with_postgres_with_backoff_with_rollback(self): app_version='1.0', app_description='app description', values_source_list=[{'backoff_delays': [2, 4, 6, 10, 15]}], + argv_source=[] ) with config_manager.context() as config: mocked_context = config.database_class(config) diff --git a/socorro/unittest/external/elasticsearch/test_crashstorage.py b/socorro/unittest/external/elasticsearch/test_crashstorage.py index 323ee21176..fad855e4b9 100644 --- a/socorro/unittest/external/elasticsearch/test_crashstorage.py +++ b/socorro/unittest/external/elasticsearch/test_crashstorage.py @@ -89,7 +89,8 @@ def test_indexing(self, pyes_mock): values_source_list=[{ 'logger': mock_logging, 'elasticsearch_urls': 'http://elasticsearch_host:9200', - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -131,7 +132,8 @@ def test_success(self, pyes_mock): values_source_list=[{ 'logger': mock_logging, 'elasticsearch_urls': 'http://elasticsearch_host:9200', - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -183,7 +185,8 @@ def test_failure_no_retry(self, pyes_mock): values_source_list=[{ 'logger': mock_logging, 'elasticsearch_urls': 'http://elasticsearch_host:9200', - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -245,7 +248,8 @@ def test_failure_limited_retry(self, pyes_mock): 'backoff_delays': [0, 0, 0], 'transaction_executor_class': TransactionExecutorWithLimitedBackoff - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -307,7 +311,8 @@ def test_success_after_limited_retry(self, pyes_mock): 'backoff_delays': [0, 0, 0], 'transaction_executor_class': TransactionExecutorWithLimitedBackoff - }] + }], + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/external/elasticsearch/test_search.py b/socorro/unittest/external/elasticsearch/test_search.py index fc8fde9911..97fd7f6959 100644 --- a/socorro/unittest/external/elasticsearch/test_search.py +++ b/socorro/unittest/external/elasticsearch/test_search.py @@ -334,7 +334,8 @@ def get_config_manager(self): 'elasticsearch_index': webapi.elasticsearch_index, 'elasticsearch_urls': webapi.elasticsearch_urls, 'backoff_delays': [1, 2], - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/elasticsearch/test_supersearch.py b/socorro/unittest/external/elasticsearch/test_supersearch.py index 89121d5dfb..2acbb9b07e 100644 --- a/socorro/unittest/external/elasticsearch/test_supersearch.py +++ b/socorro/unittest/external/elasticsearch/test_supersearch.py @@ -62,7 +62,8 @@ def _get_config_manager(config, es_index=None): 'elasticsearch_index': es_index, 'elasticsearch_urls': elasticsearch_url, 'backoff_delays': [1, 2], - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/elasticsearch/unittestbase.py b/socorro/unittest/external/elasticsearch/unittestbase.py index 716b5902c1..372dfb5c2a 100644 --- a/socorro/unittest/external/elasticsearch/unittestbase.py +++ b/socorro/unittest/external/elasticsearch/unittestbase.py @@ -99,7 +99,8 @@ def get_standard_config(self): config_manager = ConfigurationManager( [self.required_config], app_name='ElasticSearchTestCase', - app_description=__doc__ + app_description=__doc__, + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/external/filesystem/test_crash_data.py b/socorro/unittest/external/filesystem/test_crash_data.py index 385ef972d4..5605635eba 100644 --- a/socorro/unittest/external/filesystem/test_crash_data.py +++ b/socorro/unittest/external/filesystem/test_crash_data.py @@ -75,7 +75,8 @@ def _common_config_setup(self): 'std_fs_root': self.std_tmp_dir, 'def_fs_root': self.def_tmp_dir, 'pro_fs_root': self.pro_tmp_dir, - }}] + }}], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/filesystem/test_crashstorage.py b/socorro/unittest/external/filesystem/test_crashstorage.py index aa5e1e3530..ad5ebdef2a 100644 --- a/socorro/unittest/external/filesystem/test_crashstorage.py +++ b/socorro/unittest/external/filesystem/test_crashstorage.py @@ -58,7 +58,8 @@ def _common_config_setup(self): 'std_fs_root': self.std_tmp_dir, 'def_fs_root': self.def_tmp_dir, 'pro_fs_root': self.pro_tmp_dir, - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/fs/test_fsdatedradixtreestorage.py b/socorro/unittest/external/fs/test_fsdatedradixtreestorage.py index 2ed02c9264..262b1c8c17 100644 --- a/socorro/unittest/external/fs/test_fsdatedradixtreestorage.py +++ b/socorro/unittest/external/fs/test_fsdatedradixtreestorage.py @@ -31,7 +31,8 @@ def _common_config_setup(self): values_source_list=[{ 'logger': mock_logging, 'minute_slice_interval': 1 - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py b/socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py index 142f84c744..e1789739ba 100644 --- a/socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py +++ b/socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py @@ -31,7 +31,8 @@ def _common_config_setup(self): values_source_list=[{ 'logger': mock_logging, 'minute_slice_interval': 1 - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/fs/test_fsradixtreestorage.py b/socorro/unittest/external/fs/test_fsradixtreestorage.py index 828d65fe10..519d2bdb22 100644 --- a/socorro/unittest/external/fs/test_fsradixtreestorage.py +++ b/socorro/unittest/external/fs/test_fsradixtreestorage.py @@ -31,7 +31,8 @@ def _common_config_setup(self): app_description='app description', values_source_list=[{ 'logger': mock_logging - }] + }], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/hbase/test_crash_data.py b/socorro/unittest/external/hbase/test_crash_data.py index fbef6ddfb1..ede11e3c96 100644 --- a/socorro/unittest/external/hbase/test_crash_data.py +++ b/socorro/unittest/external/hbase/test_crash_data.py @@ -100,7 +100,8 @@ def _common_config_setup(self): app_description='app description', values_source_list=[{'hbase': { 'logger': mock_logging - }}] + }}], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/hbase/test_crashstorage.py b/socorro/unittest/external/hbase/test_crashstorage.py index 8ec54922a8..e42a3d3eb7 100644 --- a/socorro/unittest/external/hbase/test_crashstorage.py +++ b/socorro/unittest/external/hbase/test_crashstorage.py @@ -91,7 +91,8 @@ def test_basic_hbase_crashstorage(self): 'hbase_timeout': 100, 'hbase_host': commonconfig.hbaseHost.default, 'hbase_port': commonconfig.hbasePort.default, - }] + }], + argv_source=[] ) with config_manager.context() as config: crashstorage = HBaseCrashStorage(config) @@ -176,7 +177,8 @@ def test_hbase_crashstorage_basic_error(self): 'hbase_timeout': 100, 'hbase_host': commonconfig.hbaseHost.default, 'hbase_port': commonconfig.hbasePort.default, - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -312,7 +314,8 @@ def test_hbase_crashstorage_puts_and_gets(self): 'transaction_executor_class': TransactionExecutorWithLimitedBackoff, 'backoff_delays': [0, 0, 0], - }] + }], + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/external/postgresql/test_crashstorage.py b/socorro/unittest/external/postgresql/test_crashstorage.py index 4391b46c15..599eacfefb 100644 --- a/socorro/unittest/external/postgresql/test_crashstorage.py +++ b/socorro/unittest/external/postgresql/test_crashstorage.py @@ -93,7 +93,8 @@ def _setup_config_manager(self, extra_value_source=None): app_description='app description', values_source_list=[{ 'logger': mock_logging, - }, extra_value_source] + }, extra_value_source], + argv_source=[] ) return config_manager @@ -246,7 +247,8 @@ def test_basic_postgres_save_raw_crash(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -305,7 +307,8 @@ def test_basic_key_error_on_save_processed(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -340,7 +343,8 @@ def test_basic_postgres_save_processed_success(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -398,7 +402,8 @@ def test_basic_postgres_save_processed_success2(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -459,7 +464,8 @@ def test_basic_postgres_save_processed_operational_error(self): 'transaction_executor_class': TransactionExecutorWithLimitedBackoff, 'backoff_delays': [0, 0, 0], - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -503,7 +509,8 @@ def test_basic_postgres_save_processed_succeed_after_failures(self): 'transaction_executor_class': TransactionExecutorWithLimitedBackoff, 'backoff_delays': [0, 0, 0], - }] + }], + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/external/postgresql/test_setupdb_app.py b/socorro/unittest/external/postgresql/test_setupdb_app.py index bb41cf2112..8c4b60460c 100644 --- a/socorro/unittest/external/postgresql/test_setupdb_app.py +++ b/socorro/unittest/external/postgresql/test_setupdb_app.py @@ -85,7 +85,8 @@ def _setup_config_manager(self, extra_value_source=None): app_description=__doc__, values_source_list=[{ 'logger': mock_logging, - }, extra_value_source] + }, extra_value_source], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/external/postgresql/unittestbase.py b/socorro/unittest/external/postgresql/unittestbase.py index aa4fe07284..0a0e8d5469 100644 --- a/socorro/unittest/external/postgresql/unittestbase.py +++ b/socorro/unittest/external/postgresql/unittestbase.py @@ -103,7 +103,8 @@ def get_standard_config(self): [self.required_config, ], app_name='PostgreSQLTestCase', - app_description=__doc__ + app_description=__doc__, + argv_source=[] ) with config_manager.context() as config: diff --git a/socorro/unittest/external/test_crashstorage_base.py b/socorro/unittest/external/test_crashstorage_base.py index 2f9869092e..33aa49902b 100644 --- a/socorro/unittest/external/test_crashstorage_base.py +++ b/socorro/unittest/external/test_crashstorage_base.py @@ -67,7 +67,8 @@ def test_basic_crashstorage(self): app_description='app description', values_source_list=[{ 'logger': mock_logging, - }] + }], + argv_source=[] ) with config_manager.context() as config: @@ -226,7 +227,11 @@ def test_fallback_crash_storage(self): 'fallback.storage_class': 'socorro.unittest.external.test_crashstorage_base.B', } - cm = ConfigurationManager(n, values_source_list=[value]) + cm = ConfigurationManager( + n, + values_source_list=[value], + argv_source=[] + ) with cm.context() as config: self.assertEqual(config.primary.storage_class.foo, 'a') self.assertEqual(config.fallback.storage_class.foo, 'b') @@ -449,7 +454,11 @@ def test_processed_crash_storage(self): 'socorro.unittest.external.test_crashstorage_base.B', 'deferral_criteria': lambda x: x.get('foo') == 'foo' } - cm = ConfigurationManager(n, values_source_list=[value]) + cm = ConfigurationManager( + n, + values_source_list=[value], + argv_source=[] + ) with cm.context() as config: self.assertEqual(config.primary.storage_class.foo, 'a') self.assertEqual(config.deferred.storage_class.foo, 'b') diff --git a/socorro/unittest/lib/test_search_common.py b/socorro/unittest/lib/test_search_common.py index 08a071303b..79d326a743 100644 --- a/socorro/unittest/lib/test_search_common.py +++ b/socorro/unittest/lib/test_search_common.py @@ -26,6 +26,7 @@ def _get_config_manager(): app_name='testapp', app_version='1.0', app_description='app description', + argv_source=[] ) return config_manager diff --git a/socorro/unittest/middleware/test_middleware_app.py b/socorro/unittest/middleware/test_middleware_app.py index dc9029f7b7..00912749c8 100644 --- a/socorro/unittest/middleware/test_middleware_app.py +++ b/socorro/unittest/middleware/test_middleware_app.py @@ -429,7 +429,8 @@ def _setup_config_manager(self, extra_value_source=None): 'logger': mock_logging, #'crontabber.jobs': jobs_string, #'crontabber.database_file': json_file, - }, DSN, extra_value_source] + }, DSN, extra_value_source], + argv_source=[] ) return config_manager diff --git a/socorro/unittest/processor/test_registration_client.py b/socorro/unittest/processor/test_registration_client.py index 7ef5f8352c..15ecca749f 100644 --- a/socorro/unittest/processor/test_registration_client.py +++ b/socorro/unittest/processor/test_registration_client.py @@ -46,7 +46,8 @@ def test_basic_setup(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) m_registration = mock.Mock() @@ -75,7 +76,8 @@ def test_checkin_done(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) m_registration = mock.Mock() @@ -126,7 +128,8 @@ def test_checkin_not_necessary(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) m_registration = mock.Mock() @@ -174,7 +177,8 @@ def test_requested_processor_id(self): values_source_list=[{ 'logger': mock_logging, 'database_class': mock_postgres - }] + }], + argv_source=[] ) m_registration = mock.Mock() @@ -232,7 +236,8 @@ def test_select_host_mode_success(self): 'logger': mock_logging, 'database_class': mock_postgres, 'processor_id': 'host', - }] + }], + argv_source=[] ) with config_manager.context() as config: mock_os_uname_str = 'os.uname' @@ -304,7 +309,8 @@ def test_select_forcehost_mode_success(self): 'logger': mock_logging, 'database_class': mock_postgres, 'processor_id': 'forcehost', - }] + }], + argv_source=[] ) with config_manager.context() as config: mock_os_uname_str = 'os.uname' @@ -375,7 +381,8 @@ def test_select_host_mode_not_found_start_new(self): 'logger': mock_logging, 'database_class': mock_postgres, 'processor_id': 'host', - }] + }], + argv_source=[] ) with config_manager.context() as config: mock_os_uname_str = 'os.uname' @@ -450,7 +457,8 @@ def test_select_forcehost_mode_not_found_start_new(self): 'logger': mock_logging, 'database_class': mock_postgres, 'processor_id': 'forcehost', - }] + }], + argv_source=[] ) with config_manager.context() as config: mock_os_uname_str = 'os.uname' @@ -522,7 +530,8 @@ def test_select_host_mode_not_dead_fail(self): 'logger': mock_logging, 'database_class': mock_postgres, 'processor_id': 'host', - }] + }], + argv_source=[] ) with config_manager.context() as config: mock_os_uname_str = 'os.uname'