-
Notifications
You must be signed in to change notification settings - Fork 34
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
Only use stdlib based unittest runner for py >=3.5 #265
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The stdlib python test runner introduced in #256 was written assuming a python stdlib from python 3.5 or newer. Since we only officially support running on python 3.5 or newer when we added the logic to switch between the stdlib runner and the old testtools based runner we just said python >=3.0.0. However, despite our official support status for python >2.7,<3.5 there are still users out there running stestr on these python versions. The new test runner will not work for those users because unittest in stdlib changed in python 3.5 (as an aside this is the same issue I've been hitting in my attempts to get unittest2 removed from testtools). To address this problem a simple fix is to just change the if statement to be a bit more explicit and only use the new runner for python 3.5 or newer. This way stestr is more explicit about where the newer runner actually works and this should hopefully unbreak any users out there still using python 3.0 to 3.4. Fixes #264
openstack-gerrit
pushed a commit
to openstack/requirements
that referenced
this pull request
Aug 20, 2019
Held back the following lxml===4.4.1 nova tests fail https://bugs.launchpad.net/nova/+bug/1838666 websockify===0.9.0 tempest test failing, ping nova tornado===5.1.1 salt is cauing this, no eta on fix (same as the last year) stestr===2.5.0 needs merged mtreinish/stestr#265 jsonschema===3.0.2 see https://review.opendev.org/649789 oauthlib===3.1.0 keystone https://bugs.launchpad.net/keystone/+bug/1839393 kubernetes===10.0.1 openshift PINS this, only kuryr-tempest-plugin deps on it tenacity===5.1.1 failing tests in neutron Change-Id: I79baeee85f93adb2adfd01b1f02ca511073c8d78
openstack-gerrit
pushed a commit
to openstack/openstack
that referenced
this pull request
Aug 20, 2019
* Update requirements from branch 'master' - Merge "Updated from generate-constraints" - Updated from generate-constraints Held back the following lxml===4.4.1 nova tests fail https://bugs.launchpad.net/nova/+bug/1838666 websockify===0.9.0 tempest test failing, ping nova tornado===5.1.1 salt is cauing this, no eta on fix (same as the last year) stestr===2.5.0 needs merged mtreinish/stestr#265 jsonschema===3.0.2 see https://review.opendev.org/649789 oauthlib===3.1.0 keystone https://bugs.launchpad.net/keystone/+bug/1839393 kubernetes===10.0.1 openshift PINS this, only kuryr-tempest-plugin deps on it tenacity===5.1.1 failing tests in neutron Change-Id: I79baeee85f93adb2adfd01b1f02ca511073c8d78
@masayukig did you have any thoughts on this? |
masayukig
approved these changes
Aug 28, 2019
@@ -84,7 +84,7 @@ def _list(self, test): | |||
|
|||
def main(): | |||
runner = SubunitTestRunner | |||
if sys.version_info[0] >= 3: | |||
if sys.version_info[0] >= 3 and sys.version_info[1] >= 5: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to add a comment/note to understand the magic number '5' here. But I think it's not a blocker for merging because we can check it with git log/blame.
I'm sorry for my delayed review. LGTM |
openstack-gerrit
pushed a commit
to openstack/tempest
that referenced
this pull request
Sep 23, 2019
stestr which is used by Tempest internally to run the test switch the customize test runner(which use stdlib unittest) for >=py3.5 else testtools.run.- mtreinish/stestr#265 These two test runner are not compatible due to skip exception handling(due to unittest2). testtools.run treat unittestt.SkipTest as error and stdlib unittest treat unittest2.case.SkipTest raised by testtools.TestCase.skipException. testtool issue: testing-cabal/testtools#272 testtool is not so active now a days and fix is also not decided, let's add a workaround in Tempest to make it work for both test runner based on python version same as used by stestr Tempest should work perfectly with stestr<2.5.0 also which is also handled in this workaround. Change-Id: Ie9c013d4d6851d4deef57c1e4c254a9a34374e5a
openstack-gerrit
pushed a commit
to openstack/openstack
that referenced
this pull request
Sep 23, 2019
* Update tempest from branch 'master' - Merge "Add workaround to handle the testtool skip exception issue" - Add workaround to handle the testtool skip exception issue stestr which is used by Tempest internally to run the test switch the customize test runner(which use stdlib unittest) for >=py3.5 else testtools.run.- mtreinish/stestr#265 These two test runner are not compatible due to skip exception handling(due to unittest2). testtools.run treat unittestt.SkipTest as error and stdlib unittest treat unittest2.case.SkipTest raised by testtools.TestCase.skipException. testtool issue: testing-cabal/testtools#272 testtool is not so active now a days and fix is also not decided, let's add a workaround in Tempest to make it work for both test runner based on python version same as used by stestr Tempest should work perfectly with stestr<2.5.0 also which is also handled in this workaround. Change-Id: Ie9c013d4d6851d4deef57c1e4c254a9a34374e5a
gunine
pushed a commit
to sonaproject/tempest
that referenced
this pull request
Mar 27, 2020
stestr which is used by Tempest internally to run the test switch the customize test runner(which use stdlib unittest) for >=py3.5 else testtools.run.- mtreinish/stestr#265 These two test runner are not compatible due to skip exception handling(due to unittest2). testtools.run treat unittestt.SkipTest as error and stdlib unittest treat unittest2.case.SkipTest raised by testtools.TestCase.skipException. testtool issue: testing-cabal/testtools#272 testtool is not so active now a days and fix is also not decided, let's add a workaround in Tempest to make it work for both test runner based on python version same as used by stestr Tempest should work perfectly with stestr<2.5.0 also which is also handled in this workaround. Change-Id: Ie9c013d4d6851d4deef57c1e4c254a9a34374e5a
openstack-mirroring
pushed a commit
to openstack/openstack
that referenced
this pull request
Feb 9, 2022
* Update tempest from branch 'master' to 140d693f8589a15636ddadb68941c7a580eeff75 - Merge "Remove usage of unittest2" - Remove usage of unittest2 from comments when it was last touched it looks like workarounds for unittest2 might be able to be dropped. related: mtreinish/stestr#265 simplify the workaround logic around unittest2 TestCase logic Change-Id: Ibac9d0c2fa2f30605dd44ee58b84946464ea6449
openstack-mirroring
pushed a commit
to openstack/tempest
that referenced
this pull request
Feb 9, 2022
from comments when it was last touched it looks like workarounds for unittest2 might be able to be dropped. related: mtreinish/stestr#265 simplify the workaround logic around unittest2 TestCase logic Change-Id: Ibac9d0c2fa2f30605dd44ee58b84946464ea6449
tanaypf9
pushed a commit
to tanaypf9/pf9-requirements
that referenced
this pull request
May 20, 2024
Held back the following lxml===4.4.1 nova tests fail https://bugs.launchpad.net/nova/+bug/1838666 websockify===0.9.0 tempest test failing, ping nova tornado===5.1.1 salt is cauing this, no eta on fix (same as the last year) stestr===2.5.0 needs merged mtreinish/stestr#265 jsonschema===3.0.2 see https://review.opendev.org/649789 oauthlib===3.1.0 keystone https://bugs.launchpad.net/keystone/+bug/1839393 kubernetes===10.0.1 openshift PINS this, only kuryr-tempest-plugin deps on it Change-Id: I79baeee85f93adb2adfd01b1f02ca511073c8d78
tanaypf9
pushed a commit
to tanaypf9/pf9-requirements
that referenced
this pull request
May 20, 2024
Held back the following lxml===4.4.1 nova tests fail https://bugs.launchpad.net/nova/+bug/1838666 tornado===5.1.1 salt is cauing this, no eta on fix (same as the last year) websockify===0.9.0 tempest test failing, ping nova stestr===2.5.0 needs merged mtreinish/stestr#265 jsonschema===3.0.2 see https://review.opendev.org/649789 oauthlib===3.1.0 keystone https://bugs.launchpad.net/keystone/+bug/1839393 Change-Id: I79baeee85f93adb2adfd01b1f02ca511073c8d78
tanaypf9
pushed a commit
to tanaypf9/pf9-requirements
that referenced
this pull request
May 20, 2024
Held back the following lxml===4.4.1 nova tests fail https://bugs.launchpad.net/nova/+bug/1838666 websockify===0.9.0 tempest test failing, ping nova stestr===2.5.0 needs merged mtreinish/stestr#265 jsonschema===3.0.2 see https://review.opendev.org/649789 oauthlib===3.1.0 keystone https://bugs.launchpad.net/keystone/+bug/1839393 Change-Id: I79baeee85f93adb2adfd01b1f02ca511073c8d78
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stdlib python test runner introduced in #256 was written assuming a
python stdlib from python 3.5 or newer. Since we only officially support
running on python 3.5 or newer when we added the logic to switch between
the stdlib runner and the old testtools based runner we just said
python >=3.0.0. However, despite our official support status for
python >2.7,<3.5 there are still users out there running stestr on these python
versions. The new test runner will not work for those users because
unittest in stdlib changed in python 3.5 (as an aside this is the same
issue I've been hitting in my attempts to get unittest2 removed from
testtools). To address this problem a simple fix is to just change the
if statement to be a bit more explicit and only use the new runner for
python 3.5 or newer. This way stestr is more explicit about where the
newer runner actually works and this should hopefully unbreak any users
out there still using python 3.0 to 3.4.
Fixes #264