Skip to content
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

Fixed regular expression in test for Plone version. #396

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

mauritsvanrees
Copy link
Sponsor Member

Plone 5.1.0.1 gives a test failure on Jenkins, because the fourth level was not expected:

Regexp didn't match: '^(\\d+\\.\\d+|\\d+\\.\\d+\\.\\d+)(a\\d+|b\\d+|rc\\d+)?(\\.dev\\d)?$' not found in '5.1.0.1'

  File "/usr/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/home/jenkins/.buildout/eggs/plone.api-1.8.2-py2.7.egg/plone/api/tests/test_env.py", line 434, in test_plone_version
    '^(\d+\.\d+|\d+\.\d+\.\d+)(a\d+|b\d+|rc\d+)?(\.dev\d)?$',
  File "/usr/lib/python2.7/unittest/case.py", line 1002, in assertRegexpMatches
    raise self.failureException(msg)

We could maybe use pkg_resources.parse_version or distutils or packaging. See stackoverflow for some options.
But I opted to change the regexp that we were using.

Plone 5.1.0.1 gave a test failure, because the fourth level was not expected.
Copy link
Member

@hvelarde hvelarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mauritsvanrees
Copy link
Sponsor Member Author

Travis fails, but it was already failing. This is the QA part.

This fixes Jenkins 5.1. I will merge now.

@mauritsvanrees mauritsvanrees merged commit 194955e into master Feb 15, 2018
@mauritsvanrees mauritsvanrees deleted the fix-plone-version-check-regexp branch February 15, 2018 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants