Re: [openstack-dev] [heat][oslo] heat unit tests mocking private parts of oslo.messaging

2015-01-06 Thread Jay Pipes

On 01/05/2015 06:03 PM, Doug Hellmann wrote:

As part of updating oslo.messaging to move it out of the oslo
namespace package I ran into some issues with heat. While debugging,
I tried running the heat unit tests using the modified version of
oslo.messaging and ran into test failures because the tests are
mocking private parts of the library that are moving to have new
names.


It's just never polite to mock someone's private parts.

Best,
-jay

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [heat][oslo] heat unit tests mocking private parts of oslo.messaging

2015-01-05 Thread Doug Hellmann
As part of updating oslo.messaging to move it out of the oslo namespace package 
I ran into some issues with heat. While debugging, I tried running the heat 
unit tests using the modified version of oslo.messaging and ran into test 
failures because the tests are mocking private parts of the library that are 
moving to have new names.

Mocking internal parts of Oslo libraries isn’t supported, and so I need someone 
from the heat team to work with me to fix the heat tests and possibly add 
missing fixtures to oslo.messaging to avoid breaking heat when we release the 
updated oslo.messaging. I tried raising attention on IRC in #heat but I think 
I’m in the wrong timezone compared to most of the heat devs.

Here’s an example of one of the failing tests:

==
FAIL: 
heat.tests.test_stack_lock.StackLockTest.test_failed_acquire_existing_lock_engine_alive
tags: worker-3
--
Traceback (most recent call last):
  File heat/tests/test_stack_lock.py, line 84, in 
test_failed_acquire_existing_lock_engine_alive
self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
AttributeError: 'module' object has no attribute '_CallContext'
Traceback (most recent call last):
_StringException: Empty attachments:
  pythonlogging:'alembic'
  pythonlogging:'cliff'
  pythonlogging:'heat-provision'
  pythonlogging:'heat_integrationtests'
  pythonlogging:'heatclient'
  pythonlogging:'iso8601'
  pythonlogging:'keystoneclient'
  pythonlogging:'migrate'
  pythonlogging:'neutronclient'
  pythonlogging:'novaclient'
  pythonlogging:'oslo'
  pythonlogging:'oslo_config'
  pythonlogging:'oslo_messaging'
  pythonlogging:'requests'
  pythonlogging:'routes'
  pythonlogging:'saharaclient'
  pythonlogging:'sqlalchemy'
  pythonlogging:'stevedore'
  pythonlogging:'swiftclient'
  pythonlogging:'troveclient'

pythonlogging:'': {{{WARNING [heat.engine.environment] Changing 
AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to OS::Heat::CWLiteAlarm}}}

Traceback (most recent call last):
  File heat/tests/test_stack_lock.py, line 84, in 
test_failed_acquire_existing_lock_engine_alive
self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
AttributeError: 'module' object has no attribute '_CallContext'

Traceback (most recent call last):
_StringException: Empty attachments:
  pythonlogging:'alembic'
  pythonlogging:'cliff'
  pythonlogging:'heat-provision'
  pythonlogging:'heat_integrationtests'
  pythonlogging:'heatclient'
  pythonlogging:'iso8601'
  pythonlogging:'keystoneclient'
  pythonlogging:'migrate'
  pythonlogging:'neutronclient'
  pythonlogging:'novaclient'
  pythonlogging:'oslo'
  pythonlogging:'oslo_config'
  pythonlogging:'oslo_messaging'
  pythonlogging:'requests'
  pythonlogging:'routes'
  pythonlogging:'saharaclient'
  pythonlogging:'sqlalchemy'
  pythonlogging:'stevedore'
  pythonlogging:'swiftclient'
  pythonlogging:'troveclient'

pythonlogging:'': {{{WARNING [heat.engine.environment] Changing 
AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to OS::Heat::CWLiteAlarm}}}

Traceback (most recent call last):
  File heat/tests/test_stack_lock.py, line 84, in 
test_failed_acquire_existing_lock_engine_alive
self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
AttributeError: 'module' object has no attribute ‘_CallContext'


That class _CallContext isn’t part of the public API for oslo.messaging, and so 
it is not being exposed through the redirect modules I’m creating for backwards 
compatibility. We need to look for a way to create a fixture to do whatever it 
is these tests are trying to do — I don’t understand the tests, which is why I 
need a heat developer to help out.

Doug


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [heat][oslo] heat unit tests mocking private parts of oslo.messaging

2015-01-05 Thread Angus Salkeld
On Tue, Jan 6, 2015 at 9:03 AM, Doug Hellmann d...@doughellmann.com wrote:

 As part of updating oslo.messaging to move it out of the oslo namespace
 package I ran into some issues with heat. While debugging, I tried running
 the heat unit tests using the modified version of oslo.messaging and ran
 into test failures because the tests are mocking private parts of the
 library that are moving to have new names.

 Mocking internal parts of Oslo libraries isn’t supported, and so I need
 someone from the heat team to work with me to fix the heat tests and
 possibly add missing fixtures to oslo.messaging to avoid breaking heat when
 we release the updated oslo.messaging. I tried raising attention on IRC in
 #heat but I think I’m in the wrong timezone compared to most of the heat
 devs.


Hi Doug,

This should help you along: https://review.openstack.org/#/c/145094/

-Angus



 Here’s an example of one of the failing tests:

 ==
 FAIL:
 heat.tests.test_stack_lock.StackLockTest.test_failed_acquire_existing_lock_engine_alive
 tags: worker-3
 --
 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute '_CallContext'
 Traceback (most recent call last):
 _StringException: Empty attachments:
   pythonlogging:'alembic'
   pythonlogging:'cliff'
   pythonlogging:'heat-provision'
   pythonlogging:'heat_integrationtests'
   pythonlogging:'heatclient'
   pythonlogging:'iso8601'
   pythonlogging:'keystoneclient'
   pythonlogging:'migrate'
   pythonlogging:'neutronclient'
   pythonlogging:'novaclient'
   pythonlogging:'oslo'
   pythonlogging:'oslo_config'
   pythonlogging:'oslo_messaging'
   pythonlogging:'requests'
   pythonlogging:'routes'
   pythonlogging:'saharaclient'
   pythonlogging:'sqlalchemy'
   pythonlogging:'stevedore'
   pythonlogging:'swiftclient'
   pythonlogging:'troveclient'

 pythonlogging:'': {{{WARNING [heat.engine.environment] Changing
 AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to
 OS::Heat::CWLiteAlarm}}}

 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute '_CallContext'

 Traceback (most recent call last):
 _StringException: Empty attachments:
   pythonlogging:'alembic'
   pythonlogging:'cliff'
   pythonlogging:'heat-provision'
   pythonlogging:'heat_integrationtests'
   pythonlogging:'heatclient'
   pythonlogging:'iso8601'
   pythonlogging:'keystoneclient'
   pythonlogging:'migrate'
   pythonlogging:'neutronclient'
   pythonlogging:'novaclient'
   pythonlogging:'oslo'
   pythonlogging:'oslo_config'
   pythonlogging:'oslo_messaging'
   pythonlogging:'requests'
   pythonlogging:'routes'
   pythonlogging:'saharaclient'
   pythonlogging:'sqlalchemy'
   pythonlogging:'stevedore'
   pythonlogging:'swiftclient'
   pythonlogging:'troveclient'

 pythonlogging:'': {{{WARNING [heat.engine.environment] Changing
 AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to
 OS::Heat::CWLiteAlarm}}}

 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute ‘_CallContext'


 That class _CallContext isn’t part of the public API for oslo.messaging,
 and so it is not being exposed through the redirect modules I’m creating
 for backwards compatibility. We need to look for a way to create a fixture
 to do whatever it is these tests are trying to do — I don’t understand the
 tests, which is why I need a heat developer to help out.

 Doug


 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [heat][oslo] heat unit tests mocking private parts of oslo.messaging

2015-01-05 Thread Doug Hellmann

 On Jan 5, 2015, at 6:54 PM, Angus Salkeld asalk...@mirantis.com wrote:
 
 On Tue, Jan 6, 2015 at 9:03 AM, Doug Hellmann d...@doughellmann.com wrote:
 As part of updating oslo.messaging to move it out of the oslo namespace 
 package I ran into some issues with heat. While debugging, I tried running 
 the heat unit tests using the modified version of oslo.messaging and ran into 
 test failures because the tests are mocking private parts of the library that 
 are moving to have new names.
 
 Mocking internal parts of Oslo libraries isn’t supported, and so I need 
 someone from the heat team to work with me to fix the heat tests and possibly 
 add missing fixtures to oslo.messaging to avoid breaking heat when we release 
 the updated oslo.messaging. I tried raising attention on IRC in #heat but I 
 think I’m in the wrong timezone compared to most of the heat devs.
 
 Hi Doug,
 
 This should help you along: https://review.openstack.org/#/c/145094/

That looks good, thanks!

Doug

 
 -Angus
  
 
 Here’s an example of one of the failing tests:
 
 ==
 FAIL: 
 heat.tests.test_stack_lock.StackLockTest.test_failed_acquire_existing_lock_engine_alive
 tags: worker-3
 --
 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in 
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute '_CallContext'
 Traceback (most recent call last):
 _StringException: Empty attachments:
   pythonlogging:'alembic'
   pythonlogging:'cliff'
   pythonlogging:'heat-provision'
   pythonlogging:'heat_integrationtests'
   pythonlogging:'heatclient'
   pythonlogging:'iso8601'
   pythonlogging:'keystoneclient'
   pythonlogging:'migrate'
   pythonlogging:'neutronclient'
   pythonlogging:'novaclient'
   pythonlogging:'oslo'
   pythonlogging:'oslo_config'
   pythonlogging:'oslo_messaging'
   pythonlogging:'requests'
   pythonlogging:'routes'
   pythonlogging:'saharaclient'
   pythonlogging:'sqlalchemy'
   pythonlogging:'stevedore'
   pythonlogging:'swiftclient'
   pythonlogging:'troveclient'
 
 pythonlogging:'': {{{WARNING [heat.engine.environment] Changing 
 AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to OS::Heat::CWLiteAlarm}}}
 
 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in 
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute '_CallContext'
 
 Traceback (most recent call last):
 _StringException: Empty attachments:
   pythonlogging:'alembic'
   pythonlogging:'cliff'
   pythonlogging:'heat-provision'
   pythonlogging:'heat_integrationtests'
   pythonlogging:'heatclient'
   pythonlogging:'iso8601'
   pythonlogging:'keystoneclient'
   pythonlogging:'migrate'
   pythonlogging:'neutronclient'
   pythonlogging:'novaclient'
   pythonlogging:'oslo'
   pythonlogging:'oslo_config'
   pythonlogging:'oslo_messaging'
   pythonlogging:'requests'
   pythonlogging:'routes'
   pythonlogging:'saharaclient'
   pythonlogging:'sqlalchemy'
   pythonlogging:'stevedore'
   pythonlogging:'swiftclient'
   pythonlogging:'troveclient'
 
 pythonlogging:'': {{{WARNING [heat.engine.environment] Changing 
 AWS::CloudWatch::Alarm from OS::Heat::CWLiteAlarm to OS::Heat::CWLiteAlarm}}}
 
 Traceback (most recent call last):
   File heat/tests/test_stack_lock.py, line 84, in 
 test_failed_acquire_existing_lock_engine_alive
 self.m.StubOutWithMock(messaging.rpc.client._CallContext, call)
 AttributeError: 'module' object has no attribute ‘_CallContext'
 
 
 That class _CallContext isn’t part of the public API for oslo.messaging, and 
 so it is not being exposed through the redirect modules I’m creating for 
 backwards compatibility. We need to look for a way to create a fixture to do 
 whatever it is these tests are trying to do — I don’t understand the tests, 
 which is why I need a heat developer to help out.
 
 Doug
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev