@@ -7,12 +7,18 @@ min_version = 4.4.0
7
7
envlist =
8
8
lint
9
9
test
10
+ py313-plone62
11
+ py310-plone61
10
12
dependencies
11
13
12
14
13
15
# #
14
16
# Add extra configuration options in .meta.toml:
17
+ # - to specify a custom testing combination of Plone and python versions, use `test_matrix`
18
+ # - to specify extra custom environments, use `envlist_lines`
19
+ # - to specify extra `tox` top-level options, use `config_lines`
15
20
# [tox]
21
+ # test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["3.10", "3.9"]}
16
22
# envlist_lines = """
17
23
# my_other_environment
18
24
# """
@@ -21,32 +27,14 @@ envlist =
21
27
# """
22
28
# #
23
29
24
- [testenv]
25
- skip_install = true
26
- allowlist_externals =
27
- echo
28
- false
29
- # Make sure typos like `tox -e formaat` are caught instead of silently doing nothing.
30
- # See https://github.com/tox-dev/tox/issues/2858.
31
- commands =
32
- echo " Unrecognized environment name {envname}"
33
- false
34
-
35
- # #
36
- # Add extra configuration options in .meta.toml:
37
- # [tox]
38
- # testenv_options = """
39
- # basepython = /usr/bin/python3.8
40
- # """
41
- # #
42
-
43
30
[testenv:init]
44
31
description = Prepare environment
45
32
skip_install = true
33
+ allowlist_externals =
34
+ echo
46
35
commands =
47
36
echo " Initial setup complete"
48
37
49
-
50
38
[testenv:format]
51
39
description = automatically reformat code
52
40
skip_install = true
@@ -87,8 +75,19 @@ deps =
87
75
commands =
88
76
sh -c ' pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'
89
77
90
- [testenv:test]
91
- description = run the distribution tests
78
+
79
+ [test_runner]
80
+ deps = zope.testrunner
81
+ test =
82
+ zope-testrunner --all --test-path ={toxinidir}/src -s plone.staticresources {posargs}
83
+ coverage =
84
+ coverage run --branch --source plone.staticresources {envbindir}/zope-testrunner --quiet --all --test-path ={toxinidir}/src -s plone.staticresources {posargs}
85
+ coverage report -m --format markdown
86
+ coverage xml
87
+ coverage html
88
+
89
+ [base]
90
+ description = shared configuration for tests and coverage
92
91
use_develop = true
93
92
skip_install = false
94
93
constrain_package_deps = true
@@ -104,62 +103,79 @@ set_env =
104
103
#
105
104
# Set constrain_package_deps .meta.toml:
106
105
# [tox]
107
- # constrain_package_deps = " false"
106
+ # constrain_package_deps = false
108
107
# #
109
108
deps =
110
- zope.testrunner
111
- -c https://dist.plone.org/release/6.1-latest/constraints.txt
109
+ {[test_runner]deps}
110
+ plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt
111
+ plone61: -c https://dist.plone.org/release/6.1-dev/constraints.txt
112
112
113
113
# #
114
114
# Specify additional deps in .meta.toml:
115
115
# [tox]
116
- # test_deps_additional = "-esources/plonegovbr.portal_base[test]"
116
+ # test_deps_additional = """
117
+ # -esources/plonegovbr.portal_base[test]
118
+ # """
117
119
#
118
120
# Specify a custom constraints file in .meta.toml:
119
121
# [tox]
120
122
# constraints_file = "https://my-server.com/constraints.txt"
121
123
# #
122
- commands =
123
- zope-testrunner --all --test-path ={toxinidir}/src -s plone.staticresources {posargs}
124
124
extras =
125
125
test
126
126
127
+
127
128
# #
128
129
# Add extra configuration options in .meta.toml:
129
130
# [tox]
130
131
# test_extras = """
131
132
# tests
132
133
# widgets
133
134
# """
135
+ #
136
+ # Add extra configuration options in .meta.toml:
137
+ # [tox]
138
+ # testenv_options = """
139
+ # basepython = /usr/bin/python3.8
140
+ # """
134
141
# #
135
142
143
+ [testenv:test]
144
+ description = run the distribution tests
145
+ use_develop = {[base]use_develop}
146
+ skip_install = {[base]skip_install}
147
+ constrain_package_deps = {[base]constrain_package_deps}
148
+ set_env = {[base]set_env}
149
+ deps =
150
+ {[test_runner]deps}
151
+ -c https://dist.plone.org/release/6.2-dev/constraints.txt
152
+ commands = {[test_runner]test}
153
+ extras = {[base]extras}
154
+
155
+
156
+ [testenv]
157
+ description = run the distribution tests (generative environments)
158
+ use_develop = {[base]use_develop}
159
+ skip_install = {[base]skip_install}
160
+ constrain_package_deps = {[base]constrain_package_deps}
161
+ set_env = {[base]set_env}
162
+ deps = {[base]deps}
163
+ commands = {[test_runner]test}
164
+ extras = {[base]extras}
165
+
166
+
136
167
[testenv:coverage]
137
168
description = get a test coverage report
138
- use_develop = true
139
- skip_install = false
140
- constrain_package_deps = true
141
- set_env =
142
- ROBOT_BROWSER =headlesschrome
143
-
144
- # #
145
- # Specify extra test environment variables in .meta.toml:
146
- # [tox]
147
- # test_environment_variables = """
148
- # PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
149
- # """
150
- # #
169
+ use_develop = {[base]use_develop}
170
+ skip_install = {[base]skip_install}
171
+ constrain_package_deps = {[base]constrain_package_deps}
172
+ set_env = {[base]set_env}
151
173
deps =
174
+ {[test_runner]deps}
152
175
coverage
153
- zope.testrunner
154
- -c https://dist.plone.org/release/6.1-latest/constraints.txt
155
-
156
- commands =
157
- coverage run --branch --source plone.staticresources {envbindir}/zope-testrunner --quiet --all --test-path ={toxinidir}/src -s plone.staticresources {posargs}
158
- coverage report -m --format markdown
159
- coverage xml
160
- coverage html
161
- extras =
162
- test
176
+ -c https://dist.plone.org/release/6.2-dev/constraints.txt
177
+ commands = {[test_runner]coverage}
178
+ extras = {[base]extras}
163
179
164
180
165
181
[testenv:release-check]
@@ -169,7 +185,7 @@ deps =
169
185
twine
170
186
build
171
187
towncrier
172
- -c https://dist.plone.org/release/6.1-latest /constraints.txt
188
+ -c https://dist.plone.org/release/6.2-dev /constraints.txt
173
189
174
190
commands =
175
191
# fake version to not have to install the package
@@ -200,7 +216,7 @@ allowlist_externals =
200
216
deps =
201
217
pipdeptree
202
218
pipforester
203
- -c https://dist.plone.org/release/6.1-latest /constraints.txt
219
+ -c https://dist.plone.org/release/6.2-dev /constraints.txt
204
220
205
221
commands =
206
222
# Generate the full dependency tree
0 commit comments