Add htmltest environment to tox config

This commit is contained in:
Jeff Dairiki 2022-07-27 10:14:03 -07:00
parent 7a6ccd0e38
commit df7b6dd8c6
2 changed files with 32 additions and 5 deletions

View File

@ -1,6 +1,8 @@
IgnoreAltMissing: true IgnoreAltMissing: true
IgnoreURLs: IgnoreURLs:
- "^http://localhost:" - "^http://localhost:"
# For unknown reasons, htmltest reports a 404 on these one:
- "^https://twitter.com/"
# htmltest does not like quotes around URL in meta refresh # htmltest does not like quotes around URL in meta refresh
CheckMetaRefresh: false CheckMetaRefresh: false

35
tox.ini
View File

@ -1,12 +1,37 @@
[tox] [tox]
minversion = 3 minversion = 3.18
envlist = py envlist = build
skipsdist = true skipsdist = true
[testenv] [testenv]
deps = deps =
lektor lektor
jinja2>=3 setenv =
# Keep Lektor's private package cache in tox env rather than ~/.cache
XDG_CACHE_HOME = {envdir}/cache
LOCALAPPDATA = {envdir}/cache
[testenv:build]
commands = commands =
lektor plugins reinstall lektor build -O {envdir}/output
lektor build
[testenv:htmltest]
# Build site and check links with htmltest
#
# By default, only internal links are checked.
#
# tox -e htmltest
#
# To test external links as well, try (warning: slow):
#
# HTMLTEST_OPTS="" tox -e htmltest
#
allowlist_externals =
bash
commands_pre =
# Install latest version of htmltest in the tox env
bash -c '[ -f {envbindir}/htmltest ] || \
curl -s https://htmltest.wjdp.uk | bash -s -- -b {envbindir}'
commands =
{[testenv:build]commands}
htmltest -c .htmltest.yml {env:HTMLTEST_OPTS:-s} {envdir}/output