Skip to content

Commit

Permalink
Merge pull request #87 from plone/roto-backport-autopick-1.2.x
Browse files Browse the repository at this point in the history
Default to picking a free port - backport to 1.2.x
  • Loading branch information
gforcada authored Oct 5, 2018
2 parents de33c45 + dee6498 commit d71e10b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Changelog

Breaking changes:

- *add item here*
- Default to the new plone.testing default of picking the ZServer port
dynamically.
[Rotonen]

New features:

Expand Down
17 changes: 3 additions & 14 deletions src/plone/app/robotframework/variables.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
from plone.testing.z2 import ZSERVER_FIXTURE
import os
import pkg_resources

try:
from plone.testing.z2 import DEFAULT_ZSERVER_PORT
except ImportError:
# DEFAULT_ZSERVER_PORT is not defined until plone.testing == 4.0.8
DEFAULT_ZSERVER_PORT = 55001

# plone.testing checks environment to allow overriding DEFAULT_ZSERVER_PORT
ZSERVER_PORT = os.environ.get('ZSERVER_PORT', DEFAULT_ZSERVER_PORT)

# Allow specifying HOST and PORT through environment variables for instance,
# if tests should go through a proxy
ZOPE_HOST = os.environ.get('ZOPE_HOST', 'localhost')
ZOPE_PORT = os.environ.get('ZOPE_PORT', ZSERVER_PORT)
ZOPE_HOST = ZSERVER_FIXTURE.host
ZOPE_PORT = ZSERVER_FIXTURE.port

CMFPLONE_VERSION = pkg_resources.get_distribution('Products.CMFPlone').version
if CMFPLONE_VERSION.startswith('4.'):
CMFPLONE_SELECTORS = 'selectors/cmfplone43.robot'
elif CMFPLONE_VERSION.startswith('5.'):
CMFPLONE_SELECTORS = 'selectors/cmfplone50.robot'

0 comments on commit d71e10b

Please sign in to comment.