New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Python 2.6 unit testing and fixing Google tests. #648

Closed
wants to merge 1 commit into
base: trunk
from

Conversation

Projects
None yet
5 participants
@crunk1
Contributor

crunk1 commented Dec 2, 2015

@jimbobhickville

This comment has been minimized.

Show comment
Hide comment
@jimbobhickville

jimbobhickville Dec 2, 2015

Contributor

+1 - looks like you covered everything I found and then some.

Contributor

jimbobhickville commented Dec 2, 2015

+1 - looks like you covered everything I found and then some.

@jimbobhickville

This comment has been minimized.

Show comment
Hide comment
@jimbobhickville

jimbobhickville Dec 2, 2015

Contributor

Btw, this should fix https://issues.apache.org/jira/browse/LIBCLOUD-776 - I forget the exact syntax you put in the commit message to have it automatically close the ticket, but I believe there's a way to do that.

Contributor

jimbobhickville commented Dec 2, 2015

Btw, this should fix https://issues.apache.org/jira/browse/LIBCLOUD-776 - I forget the exact syntax you put in the commit message to have it automatically close the ticket, but I believe there's a way to do that.

@tonybaloney

This comment has been minimized.

Show comment
Hide comment
@tonybaloney

tonybaloney Dec 2, 2015

Contributor

👍 looks much cleaner

Contributor

tonybaloney commented Dec 2, 2015

👍 looks much cleaner

@crunk1

This comment has been minimized.

Show comment
Hide comment
@crunk1

crunk1 Dec 2, 2015

Contributor

Sorry, still working on it. I have been able to repro it on python2.6. Still fixing atm.

Contributor

crunk1 commented Dec 2, 2015

Sorry, still working on it. I have been able to repro it on python2.6. Still fixing atm.

@crunk1

This comment has been minimized.

Show comment
Hide comment
@crunk1

crunk1 Dec 2, 2015

Contributor

It appears that unittest in python 2.6 does not have setUpClass...

Contributor

crunk1 commented Dec 2, 2015

It appears that unittest in python 2.6 does not have setUpClass...

@crunk1

This comment has been minimized.

Show comment
Hide comment
@crunk1

crunk1 Dec 2, 2015

Contributor

Interesting... libcloud/testing/init.py:27 shows that they try to mitigate that problem with python 2.6's unittest module by importing unittest2 (which is 2.7's module). But that seems to not be working.

@Kami comment?

Contributor

crunk1 commented Dec 2, 2015

Interesting... libcloud/testing/init.py:27 shows that they try to mitigate that problem with python 2.6's unittest module by importing unittest2 (which is 2.7's module). But that seems to not be working.

@Kami comment?

@crunk1

This comment has been minimized.

Show comment
Hide comment
@crunk1

crunk1 Dec 2, 2015

Contributor

Could be setup.py:21. It looks like the TestRunner is getting imported from Python 2.6's unittest module, which would explain why setUpClass isn't being called.

Contributor

crunk1 commented Dec 2, 2015

Could be setup.py:21. It looks like the TestRunner is getting imported from Python 2.6's unittest module, which would explain why setUpClass isn't being called.

@crunk1

This comment has been minimized.

Show comment
Hide comment
@crunk1

crunk1 Dec 2, 2015

Contributor

@Kami please take a look at my change to setup.py.

Contributor

crunk1 commented Dec 2, 2015

@Kami please take a look at my change to setup.py.

Fix unittests on Python 2.6. Tests were being run with a Python 2.6 t…
…est runner instead of a 2.7 test runner. Using a conditional import in setup.py, tests are now run with the standard 2.7 unittest library (known as unittest2 to Python 2.6).

Modified/cleaned up Google tests. Tests were not hermetic, but now proper mocking has been put in place to make them hermetic.

Tests:
python2.7 setup.py test
python2.6 setup.py test

@crunk1 crunk1 changed the title from Modified/cleaned up Google tests. Tests were not hermetic, but now pr… to Fixing Python 2.6 unit testing and fixing Google tests. Dec 2, 2015

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Dec 2, 2015

Member

@crunk1 setup.py change looks good to me - good catch!

Member

Kami commented Dec 2, 2015

@crunk1 setup.py change looks good to me - good catch!

@erjohnso

This comment has been minimized.

Show comment
Hide comment
@erjohnso

erjohnso Dec 2, 2015

Member

👍 LGTM too, thanks @crunk1 and @jimbobhickville

I ran through tests on both Mac and my GCE debian instance and it all checks out. Merging it in now.

Member

erjohnso commented Dec 2, 2015

👍 LGTM too, thanks @crunk1 and @jimbobhickville

I ran through tests on both Mac and my GCE debian instance and it all checks out. Merging it in now.

@asfgit asfgit closed this in 7e087d6 Dec 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment