Skip to content

Commit

Permalink
Run the windows tests on GHA instead of AppVeyor. (#975)
Browse files Browse the repository at this point in the history
Make tests compatible with Windows.
  • Loading branch information
Michael Howitz authored Jun 4, 2021
1 parent 3f056ab commit 00094d5
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ max_line_length = off
# 4 space indentation
indent_size = 4

[*.{yml,zpt,pt,dtml}]
[*.{yml,zpt,pt,dtml,zcml}]
# 2 space indentation
indent_size = 2

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ on:
jobs:
build:
strategy:
# We want do see all failures:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ubuntu
- windows
config:
# [Python version, tox env]
- ["3.8", "lint"]
Expand All @@ -25,9 +28,13 @@ jobs:
- ["3.9", "py39"]
- ["3.8", "docs"]
- ["3.8", "coverage"]
exclude:
- { os: windows, config: ["3.8", "lint"] }
- { os: windows, config: ["3.8", "docs"] }
- { os: windows, config: ["3.8", "coverage"] }

runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.os }}-${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
32 changes: 7 additions & 25 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[meta]
template = "zope-product"
commit-id = "f8468b0bc5c92479b3043372d89cf5852176015d"
commit-id = "10891b6cf9212ecd48f9bc70138aa14324d6a2b0"

[python]
with-appveyor = true
with-appveyor = false
with-pypy = false
with-legacy-python = false
with-docs = true
with-sphinx-doctests = false
with-windows = true

[coverage]
fail-under = 80

[coverage-run]
source = "src"

[isort]
known_third_party = "ipaddress, PasteDeploy, waitress, chameleon, paste, pkg_resources"
known_zope = "AccessControl, Acquisition, App, DateTime, DocumentTemplate, ExtensionClass, MultiMapping, OFS, Persistence, persistent, Products, RestrictedPython, Shared, Testing, transaction, webdav, ZConfig, zExceptions, zmi, ZODB, zope, Zope2, ZPublisher, ZTUtils"
Expand All @@ -34,6 +38,7 @@ testenv-commands-pre = [
testenv-commands = [
"{envdir}/bin/alltests {posargs:-vc}",
]
coverage-basepython = "python3.8"
coverage-command = "coverage run {envdir}/bin/alltests {posargs:-vc}"
testenv-additional = [
"",
Expand Down Expand Up @@ -117,26 +122,3 @@ ignore-bad-ideas = [
"src/Products/Five/tests/locales/de/LC_MESSAGES/fivetest.mo",
"src/Products/Five/tests/locales/en/LC_MESSAGES/fivetest.mo",
]

[appveyor]
replacement = [
"environment:",
" matrix:",
" - TOXENV: py38",
" - TOXENV: py37",
" - TOXENV: py36",
" - TOXENV: py39",
"install:",
" - python -m pip install -U pip",
" - pip install -U setuptools wheel",
" - pip install -U tox",
"build: false",
"matrix:",
" fast_finish: true",
" allow_failures:",
" - TOXENV: py39",
"test_script:",
" - tox",
"on_success:",
" - echo Build succesful!",
]
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ include *.rst
include *.txt
include buildout.cfg
include tox.ini
include appveyor.yml

recursive-include docs *.py
recursive-include docs *.rst
Expand Down
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

5 changes: 2 additions & 3 deletions src/Products/Five/browser/tests/pages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ Test access to ``context`` from ZPTs:
Test macro access from ZPT pages:

>>> view = self.folder.unrestrictedTraverse('testoid/seagull.html')
>>> view() == ('<html><head><title>bird macro</title></head>'
... '<body>Color: gray</body></html>\n')
True
>>> print(view())
<html><head><title>bird macro</title></head><body>Color: gray</body></html>

test_zpt_things:

Expand Down
2 changes: 1 addition & 1 deletion src/Products/Five/browser/tests/test_pagetemplatefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test___call___no_previous_content_type(self):
view = self._makeView(context, request)
vptf = self._makeOne('templates/dirpage1.pt')
body = vptf(view)
self.assertEqual(body, DIRPAGE1)
self.assertEqual(body.replace('\r\n', '\n'), DIRPAGE1)
self.assertEqual(response._headers['Content-Type'], 'text/html')

def test___call___w_previous_content_type(self):
Expand Down
4 changes: 2 additions & 2 deletions src/Zope2/App/tests/test_safe_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_cook_zope3_page_templates_normal(self):
# Need to pass a namespace.
namespace = {'context': self.app}
self.assertEqual(
pt.pt_render(namespace).strip(),
pt.pt_render(namespace).strip().replace('\r\n', '\n'),
'<p>&lt;application at &gt;</p>\n'
'<p>&lt;APPLICATION AT &gt;</p>')

Expand All @@ -193,7 +193,7 @@ def test_cook_zope3_page_templates_using_format(self):
# template.
self.app.test_folder_1_.__roles__ = ['Manager']
self.assertEqual(
pt.pt_render(namespace).strip(),
pt.pt_render(namespace).strip().replace('\r\n', '\n'),
"<p>class of &lt;application at &gt; is "
"&lt;class 'ofs.application.application'&gt;</p>\n"
"<p>CLASS OF &lt;APPLICATION AT &gt; IS "
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ skip_install = true
deps =
setuptools < 52
zc.buildout
zope.testrunner
commands_pre =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install alltests
commands =
Expand Down Expand Up @@ -80,14 +79,16 @@ commands =
[testenv:docs]
basepython = python3
skip_install = false
# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
deps = Sphinx < 4
extras =
docs
commands_pre =
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html

[testenv:coverage]
basepython = python3
basepython = python3.8
skip_install = true
allowlist_externals =
mkdir
Expand Down

0 comments on commit 00094d5

Please sign in to comment.