Skip to content

add tests for 5.1 and 5.2 #11

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 48 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
language:
python
python:
2.7
env:
- PLONE_VERSION=4.3
- PLONE_VERSION=5.0
sudo: false
language: python
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
matrix:
include:
- python: 2.6
env: PLONE_VERSION=4.2
- python: 2.6
env: PLONE_VERSION=4.1
- python: "2.7"
env: PLONE_VERSION=4.1.x
- python: "2.7"
env: PLONE_VERSION=4.3.x
- python: "2.7"
env: PLONE_VERSION=5.0.x
- python: "2.7"
env: PLONE_VERSION=5.1.x
- python: "2.7"
env: PLONE_VERSION=5.2.x
- python: "3.7"
env: PLONE_VERSION=5.2.x
dist: xenial
sudo: true

cache:
pip: true
directories:
- eggs
- downloads
- $HOME/buildout-cache
before_install:
# install chrome webdriver
- mkdir webdriver;
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz;
tar -xzf geckodriver-v0.20.0-linux64.tar.gz -C webdriver;
wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip;
unzip chromedriver_linux64.zip -d webdriver;
export PATH=$PATH:$(pwd)/webdriver;
- pip2.7 install popt || pip2.7 install --user popt
install:
- sed -ie "s#travis-4.x.cfg#travis-$PLONE_VERSION.x.cfg#" travis.cfg
- sed -ie "s#buildout.cfg#buildout-$PLONE_VERSION.cfg#" travis.cfg
#- sed -ie "s#travis-4.x.cfg#travis-$PLONE_VERSION.x.cfg#" travis.cfg
#- sed -ie "s#buildout.cfg#test-$PLONE_VERSION.cfg#" travis.cfg
- mkdir -p buildout-cache/{downloads,eggs}
- python bootstrap.py -c travis.cfg
- bin/buildout -c travis.cfg -N
# - python bootstrap.py -c travis.cfg
- ./bootstrap.sh test-$PLONE_VERSION.cfg
- bin/buildout -c test-$PLONE_VERSION.cfg -N
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- 'export DISPLAY=:99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- sleep 3
- "export ROBOT_BROWSER=chrome"
script:
bin/test
- bin/test
- grep --include=output.xml -Rl FAIL parts/test | xargs --no-run-if-empty -n 1 popt
after_success:
- test -v QA && bin/coverage.sh && pip install -q coveralls && coveralls || true
2 changes: 1 addition & 1 deletion Products/PasswordStrength/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from Products.PluggableAuthService import registerMultiPlugin
from zope.i18nmessageid import MessageFactory
_ = MessageFactory("Products.PasswordStrength")
from plugin import PasswordStrength, manage_addPasswordStrength, manage_addPasswordStrengthForm
from Products.PasswordStrength.plugin import PasswordStrength, manage_addPasswordStrength, manage_addPasswordStrengthForm


def initialize(context):
Expand Down
4 changes: 2 additions & 2 deletions Products/PasswordStrength/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import logging

from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from AccessControl.class_init import InitializeClass
from OFS.Cache import Cacheable

from Products.CMFPlone.RegistrationTool import RegistrationTool
from Products.CMFPlone import PloneMessageFactory as _p
from . import _
from Products.PasswordStrength import _
from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
from Products.PluggableAuthService.utils import classImplements
from Products.PluggableAuthService.interfaces.plugins import IValidationPlugin
Expand Down
4 changes: 2 additions & 2 deletions Products/PasswordStrength/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE
from plone.app.robotframework.testing import MOCK_MAILHOST_FIXTURE

from tests.robot_setup import PasswordStrengthRemoteKeywords
from Products.PasswordStrength.tests.robot_setup import PasswordStrengthRemoteKeywords

try:
from Products.CMFPlone.tests.robot.robot_setup import CMFPloneRemoteKeywords
except ImportError:
from tests.backward_robot import CMFPloneRemoteKeywords
from Products.PasswordStrength.tests.backward_robot import CMFPloneRemoteKeywords


class Fixture(PloneSandboxLayer):
Expand Down
2 changes: 1 addition & 1 deletion Products/PasswordStrength/tests/common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Own passwords registration disabled

Input for
[arguments] ${title} ${extra_keyword} @{list}
${for}= Get Element Attribute xpath=//label[contains(., "${title}")]@for
${for}= Get Element Attribute xpath=//label[contains(., "${title}")] for
Run Keyword ${extra_keyword} id=${for} @{list}

Hint for
Expand Down
16 changes: 8 additions & 8 deletions Products/PasswordStrength/tests/robot_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ class PasswordStrengthRemoteKeywords(RemoteLibrary):

def the_inline_validation_disabled(self):
portal = getSite()
jst = getToolByName(portal, 'portal_javascripts')
js = jst.getResource('inline_validation.js')
if js and js.getEnabled():
js.setEnabled(False)
#jst = getToolByName(portal, 'portal_javascripts')
#js = jst.getResource('inline_validation.js')
#if js and js.getEnabled():
# js.setEnabled(False)

def the_inline_validation_enabled(self):
portal = getSite()
jst = getToolByName(portal, 'portal_javascripts')
js = jst.getResource('inline_validation.js')
if js and not js.getEnabled():
js.setEnabled(True)
#jst = getToolByName(portal, 'portal_javascripts')
#js = jst.getResource('inline_validation.js')
#if js and not js.getEnabled():
# js.setEnabled(True)

def get_plone_version(self):
return PLONE_VERSION
Expand Down
33 changes: 29 additions & 4 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[buildout]
extends =
versions.cfg
package-name = Products.PasswordStrength
package-extras = [test]
test-eggs =
show-picked-versions = true
allow-picked-versions = false
allow-picked-versions = true

versions = versions

Expand All @@ -15,7 +13,7 @@ extensions =
auto-checkout =

parts +=
omelette
# omelette
robot

[instance]
Expand All @@ -28,6 +26,9 @@ eggs =
${instance:eggs}
${test:eggs}

[code-analysis]
directory= ${buildout:directory}/Products.PasswordStrength

[remotes]
collective = git://github.com/collective
collective_push = git@github.com:collective
Expand All @@ -40,3 +41,27 @@ eggs =
Pillow
${test:eggs}
plone.app.robotframework [debug]

[versions]
#zc.buildout = 2.3.1
#setuptools = 17.0

#Babel = 1.3
#babel = 1.3
#createcoverage = 1.3.2
#plone.api = 1.1.0
#Pygments = 1.6
#plone.app.robotframework = 0.9.9
#robotframework = 2.8.7
#robotframework-debuglibrary = 0.3
#robotframework-selenium2library = 1.6.0
#robotframework-selenium2screenshots = 0.5.0
#robotsuite = 1.6.1
#selenium = 2.45.0
#sphinxcontrib-robotframework = 0.5.0
plone.recipe.codeanalysis = 3.0.1
check-manifest = 0.40

# Pre-Python 2.7 deprecation
configparser = 3.5.0
prettyconf = 1.2.3
6 changes: 6 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[ ! -f bin/pip ] && virtualenv .
bin/pip install --upgrade pip setuptools zc.buildout
bin/buildout -c $1 annotate | tee annotate.txt | grep -E 'setuptools *= *[0-9][^ ]*|zc.buildout *= *[0-9][^ ]*'| sed 's/= /==/' > requirements.txt
cat annotate.txt
cat requirements.txt
bin/pip install --upgrade -r requirements.txt
7 changes: 0 additions & 7 deletions buildout-4.3.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions buildout-5.0.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions buildout.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ def read(*rnames):
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Environment :: Web Environment",
"Framework :: Plone :: 4.1",
"Framework :: Plone :: 4.2",
"Framework :: Plone :: 4.3",
"Framework :: Plone :: 5.0",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: 5.2",
"Framework :: Zope2",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Zope",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
2 changes: 2 additions & 0 deletions buildout-4.1.cfg → test-4.1.x.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-4.1.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg

[instance]
Expand Down
2 changes: 2 additions & 0 deletions buildout-4.2.cfg → test-4.2.x.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-4.2.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg

[instance]
Expand Down
9 changes: 9 additions & 0 deletions test-4.3.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-4.3.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg

[versions]
plone.api = 1.1.0
6 changes: 6 additions & 0 deletions test-5.0.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.0.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg
6 changes: 6 additions & 0 deletions test-5.1.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.1.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg
9 changes: 9 additions & 0 deletions test-5.2.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.2.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg
base.cfg

#[versions]
#zc.buildout = 2.13.2
11 changes: 0 additions & 11 deletions travis.cfg

This file was deleted.

17 changes: 0 additions & 17 deletions versions.cfg

This file was deleted.