Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Feb 14, 2025
1 parent b8fb0c6 commit da8ff08
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 59 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generated from:
# https://github.com/plone/meta/tree/main/src/plone/meta/default
# See the inline comments on how to expand/tweak this configuration file
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
12 changes: 6 additions & 6 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ on:

jobs:
qa:
uses: plone/meta/.github/workflows/qa.yml@main
uses: plone/meta/.github/workflows/qa.yml@2.x
test:
uses: plone/meta/.github/workflows/test.yml@main
uses: plone/meta/.github/workflows/test.yml@2.x
coverage:
uses: plone/meta/.github/workflows/coverage.yml@main
uses: plone/meta/.github/workflows/coverage.yml@2.x
dependencies:
uses: plone/meta/.github/workflows/dependencies.yml@main
uses: plone/meta/.github/workflows/dependencies.yml@2.x
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main
uses: plone/meta/.github/workflows/release_ready.yml@2.x
circular:
uses: plone/meta/.github/workflows/circular.yml@main
uses: plone/meta/.github/workflows/circular.yml@2.x

##
# To modify the list of default jobs being created add in .meta.toml:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Generated from:
# https://github.com/plone/meta/tree/main/src/plone/meta/default
# See the inline comments on how to expand/tweak this configuration file
name: tests

on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
permissions:
contents: read
pull-requests: write
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-latest"]
config:
# [Python version, visual name, tox env]
- ["3.13", "6.1 on py3.13", "py313-plone61"]
- ["3.10", "6.1 on py3.10", "py310-plone61"]
- ["3.13", "6.0 on py3.13", "py313-plone60"]
- ["3.9", "6.0 on py3.9", "py39-plone60"]

runs-on: ${{ matrix.os[1] }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config[0] }}
allow-prereleases: true
- name: Pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[2] }}
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "006091bd"
commit-id = "2.0.1.dev0"
122 changes: 70 additions & 52 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ min_version = 4.4.0
envlist =
lint
test
py313-plone61
py312-plone61
py311-plone61
py310-plone61
py313-plone60
py312-plone60
py311-plone60
py310-plone60
py39-plone60
dependencies


Expand All @@ -21,25 +30,6 @@ envlist =
# """
##

[testenv]
skip_install = true
allowlist_externals =
echo
false
# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing.
# See https://github.com/tox-dev/tox/issues/2858.
commands =
echo "Unrecognized environment name {envname}"
false

##
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##

[testenv:init]
description = Prepare environment
skip_install = true
Expand Down Expand Up @@ -87,8 +77,19 @@ deps =
commands =
sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'

[testenv:test]
description = run the distribution tests

[test_runner]
deps = zope.testrunner
test =
zope-testrunner --all --test-path={toxinidir} -s plone.batching {posargs}
coverage =
coverage run --branch --source plone.batching {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.batching {posargs}
coverage report -m --format markdown
coverage xml
coverage html

[base]
description = shared configuration for tests and coverage
use_develop = true
skip_install = false
constrain_package_deps = true
Expand All @@ -104,62 +105,79 @@ set_env =
#
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = "false"
# constrain_package_deps = false
##
deps =
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
{[test_runner]deps}
plone61: -c https://dist.plone.org/release/6.1-dev/constraints.txt
plone60: -c https://dist.plone.org/release/6.0-dev/constraints.txt

##
# Specify additional deps in .meta.toml:
# [tox]
# test_deps_additional = "-esources/plonegovbr.portal_base[test]"
# test_deps_additional = """
# -esources/plonegovbr.portal_base[test]
# """
#
# Specify a custom constraints file in .meta.toml:
# [tox]
# constraints_file = "https://my-server.com/constraints.txt"
##
commands =
zope-testrunner --all --test-path={toxinidir} -s plone.batching {posargs}
extras =
test


##
# Add extra configuration options in .meta.toml:
# [tox]
# test_extras = """
# tests
# widgets
# """
#
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##

[testenv:test]
description = run the distribution tests
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
-c https://dist.plone.org/release/6.1-dev/constraints.txt
commands = {[test_runner]test}
extras = {[base]extras}


[testenv]
description = run the distribution tests (generative environments)
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps = {[test_runner]deps}
commands = {[test_runner]test}
extras = {[base]extras}


[testenv:coverage]
description = get a test coverage report
use_develop = true
skip_install = false
constrain_package_deps = true
set_env =
ROBOT_BROWSER=headlesschrome

##
# Specify extra test environment variables in .meta.toml:
# [tox]
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
##
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
coverage
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt

commands =
coverage run --branch --source plone.batching {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.batching {posargs}
coverage report -m --format markdown
coverage xml
coverage html
extras =
test
-c https://dist.plone.org/release/6.1-dev/constraints.txt
commands = {[test_runner]coverage}
extras = {[base]extras}


[testenv:release-check]
Expand All @@ -169,7 +187,7 @@ deps =
twine
build
towncrier
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
# fake version to not have to install the package
Expand Down Expand Up @@ -200,7 +218,7 @@ allowlist_externals =
deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
# Generate the full dependency tree
Expand Down

0 comments on commit da8ff08

Please sign in to comment.