diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65da3ec8..da23908c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,48 +1,60 @@ on: [push, pull_request] name: Tests jobs: - instance: + # instance: + # strategy: + # fail-fast: false + # matrix: + # include: + # - python-version: "2.7" + # plone-version: "5.2" + # os: "ubuntu-20.04" + # - python-version: "3.8" + # plone-version: "5.2" + # os: "ubuntu-latest" + # - python-version: "3.9" + # plone-version: "6.0" + # os: "ubuntu-latest" + # runs-on: ${{ matrix.os }} + # name: ${{ matrix.plone-version }}-${{ matrix.python-version }} start instance + # steps: + # - uses: actions/checkout@v3.3.0 + # - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # python-version: ${{ matrix.python-version }} + # plone-version: ${{ matrix.plone-version }} + # buildout-parts: "copy_ckeditor_code ckeditor instance" + # - name: Check that instance starts + # run: | + # bin/instance run startup.py + all_tests_27: strategy: fail-fast: false matrix: - include: - - python-version: "2.7" - plone-version: "5.2" - os: "ubuntu-20.04" - - python-version: "3.8" - plone-version: "5.2" - os: "ubuntu-latest" - - python-version: "3.9" - plone-version: "6.0" - os: "ubuntu-latest" - runs-on: ${{ matrix.os }} - name: ${{ matrix.plone-version }}-${{ matrix.python-version }} start instance + config: + - ["plone52-py27", "plone/test-with-tox:5.2-2.7"] + # needs: instance + runs-on: ubuntu-20.04 + container: + image: ${{ matrix.config[1] }} + name: ${{ matrix.config[0] }} steps: - - uses: actions/checkout@v3.3.0 - - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - python-version: ${{ matrix.python-version }} - plone-version: ${{ matrix.plone-version }} - buildout-parts: "copy_ckeditor_code ckeditor instance" - - name: Check that instance starts - run: | - bin/instance run startup.py + - uses: actions/checkout@v3 + - name: Test + run: tox -e ${{ matrix.config[0] }} all_tests: strategy: fail-fast: false matrix: include: - - python-version: "2.7" - plone-version: "5.2" - os: "ubuntu-20.04" - python-version: "3.8" plone-version: "5.2" os: "ubuntu-latest" - python-version: "3.9" plone-version: "6.0" os: "ubuntu-latest" - needs: instance + # needs: instance name: ${{ matrix.plone-version }}-${{ matrix.python-version }} run tests (robot inc) runs-on: ${{ matrix.os }} steps: @@ -69,18 +81,18 @@ jobs: run: | ROBOT_BROWSER=headlessFirefox bin/pytest -k "robot and not image2" ROBOT_BROWSER=headlessFirefox bin/pytest -k "robot and image2" - test_upgrade: - needs: all_tests - name: 5.2-2.7 upgrade - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.3.0 - - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action - with: - github-token: ${{ secrets.github-token }} - python-version: "2.7" - plone-version: "5.2" - buildout-parts: "copy_ckeditor_code ckeditor pytest" - - name: Run upgrade tests - run: | - bin/pytest -k "upgrade" + # test_upgrade: + # needs: all_tests + # name: 5.2-2.7 upgrade + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v3.3.0 + # - uses: collective/buildout.plonetest/.github/actions/buildout@gha-buildout-action + # with: + # github-token: ${{ secrets.github-token }} + # python-version: "2.7" + # plone-version: "5.2" + # buildout-parts: "copy_ckeditor_code ckeditor pytest" + # - name: Run upgrade tests + # run: | + # bin/pytest -k "upgrade" diff --git a/requirements-tox.txt b/requirements-tox.txt new file mode 100644 index 00000000..3f1fb9bb --- /dev/null +++ b/requirements-tox.txt @@ -0,0 +1,5 @@ +# For Buildout related packages, it is easiest to keep them at the same version for all environments. +# Keep these in sync with base.cfg please: +zc.buildout==3.0.1 +# setuptools 67 is too strict with versions +setuptools<67 diff --git a/test-4.3.x.cfg b/test-4.3.x.cfg deleted file mode 100644 index eaf855e6..00000000 --- a/test-4.3.x.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/pytest-4.3.x.cfg - base.cfg - -[plonesite] -recipe = collective.recipe.plonesite -upgrade-portal = true -upgrade-profiles = collective.ckeditor:default -profiles-initial = Products.CMFPlone:plone-content - plonetheme.sunburst:default - collective.ckeditor:default - -[versions] -six = 1.11.0 -collective.recipe.plonesite = 1.11.0 -collective.upgrade = 1.5 -zodbupdate = 0.5 diff --git a/test-5.0.x.cfg b/test-5.0.x.cfg deleted file mode 100644 index ae1a30a8..00000000 --- a/test-5.0.x.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/pytest-5.0.x.cfg - base.cfg - -[plonesite] -recipe = collective.recipe.plonesite -upgrade-portal = true -upgrade-profiles = collective.ckeditor:default -profiles-initial = Products.CMFPlone:plone-content - plonetheme.sunburst:default - collective.ckeditor:default diff --git a/test-5.1.x.cfg b/test-5.1.x.cfg deleted file mode 100644 index e3708a5f..00000000 --- a/test-5.1.x.cfg +++ /dev/null @@ -1,35 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/pytest-5.1.x.cfg - base.cfg -auto-checkout= - collective.plonefinder - collective.quickupload - plone.app.z3cform - plone.app.textfield - -parts -= code-analysis - - -[instance] -recipe = plone.recipe.zope2instance -user = admin:admin -eggs = - Plone - collective.ckeditor - -[plonesite] -recipe = collective.recipe.plonesite -upgrade-portal = true -upgrade-profiles = collective.ckeditor:default -profiles-initial = Products.CMFPlone:plone-content - plonetheme.sunburst:default - collective.ckeditor:default - -[versions] -Pygments=2.5.1 -toml = 0.10.0 - -[sources] -collective.plonefinder = git ${remotes:collective}/collective.plonefinder.git pushurl=${remotes:collective_push}/collective.plonefinder.git branch=plone5 -collective.quickupload = git ${remotes:collective}/collective.quickupload.git pushurl=${remotes:collective_push}/collective.quickupload.git branch=plone5 diff --git a/test-6.0.x.cfg b/test-6.0.x.cfg index 4faeb2db..6a8d67ab 100644 --- a/test-6.0.x.cfg +++ b/test-6.0.x.cfg @@ -13,12 +13,12 @@ eggs = Plone collective.ckeditor -[versions] -lxml = 4.7.1 -six = 1.10.0 -selenium = 4.8.0 -Pillow = 9.4.0 -wheel = 0.38.4 +# [versions] +# lxml = 4.7.1 +# six = 1.10.0 +# selenium = 4.8.0 +# Pillow = 9.4.0 +# wheel = 0.38.4 [sources] collective.plonefinder = git ${remotes:collective}/collective.plonefinder.git pushurl=${remotes:collective_push}/collective.plonefinder.git branch=plone5 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..108eb078 --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +minversion = 3.18 +envlist = + plone52-py{27,36,37,38} + plone60-py{38,39,310,311} + +[testenv] +# We do not install with pip, but with buildout: +usedevelop = false +skip_install = true +deps = + -r requirements-tox.txt +commands_pre = + plone52: {envbindir}/buildout -Nc {toxinidir}/test-5.2.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install copy_ckeditor_code ckeditor pytest + plone60: {envbindir}/buildout -Nc {toxinidir}/test-6.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install copy_ckeditor_code ckeditor pytest +commands = + {envbindir}/pytest