[tox] Have less test environments
This is to reduce the load on CI server because of parallel clones of the
repository in Docker containers. Only keep "server", and "web" environments
separated. All other prior environments are in "misc".
To avoid duplicate entries in requirements files, move them all in a
"requirements" directory (this appears to be a "common" practice, see e.g.
Celery).
Adjustments in tests:
* Rename cubicweb/hooks/test/unittest_notification.py so that it does not
conflict with cubicweb/sobjects/test/unittest_notification.py during test
discovery as they would have the same module name but different __file__
attribute.
* Add "comment" cube to the list of expected cubes in unittest_cwconfig.py as
this cube is pulled by requirements/test-mist.txt.
Closes #15440662.
[tox]
envlist =
check-manifest,flake8,
py{27,34}-{server,web,misc}
[testenv]
sitepackages = True
whitelist_externals =
/usr/bin/touch
deps =
-r{toxinidir}/requirements/dev.txt
misc: -r{toxinidir}/requirements/test-misc.txt
server: -r{toxinidir}/requirements/test-server.txt
web: -r{toxinidir}/requirements/test-web.txt
commands =
py34: touch {envdir}/share/cubicweb/cubes/__init__.py
misc: {envpython} -m pip install --upgrade --no-deps --quiet git+git://github.com/logilab/yapps@master#egg=yapps
misc: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test
py27-misc: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/etwist/test
server: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/server/test
web: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/web/test
[testenv:flake8]
skip_install = true
deps =
flake8 >= 3
commands =
flake8 {toxinidir}
# So that Jenkins JUnit plugin does not complain about missing XML results.
touch test-results.xml
[testenv:doc]
changedir = doc
deps =
sphinx
commands =
{envpython} -c 'import sphinx; sphinx.main()' -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:check-manifest]
skip_install = true
deps =
check-manifest
commands =
check-manifest {toxinidir} \
# ignore symlinks that are not recognized by check-manifest, see
# https://github.com/mgedmin/check-manifest/issues/69
--ignore cubicweb/devtools/test/data/cubes/i18ntestcube,cubicweb/test/data/legacy_cubes*
# So that Jenkins JUnit plugin does not complain about missing XML results.
touch test-results.xml
[pytest]
python_files = *test_*.py
[flake8]
format = pylint
ignore = W503
max-line-length = 100
exclude = setup.py,doc/*,cubicweb/misc/*,cubicweb/test/*,cubicweb/*/test/*,.tox/*
filename=
cubicweb/dataimport/csv.py,
cubicweb/dataimport/importer.py,
cubicweb/dataimport/massive_store.py,
cubicweb/dataimport/stores.py,
cubicweb/dataimport/test/data-massimport/schema.py,
cubicweb/dataimport/test/data/schema.py,
cubicweb/dataimport/test/test_csv.py,
cubicweb/dataimport/test/test_pgstore.py,
cubicweb/dataimport/test/test_stores.py,
cubicweb/dataimport/test/unittest_importer.py,
cubicweb/devtools/test/data/cubes/i18ntestcube/__init__.py,
cubicweb/devtools/test/data/cubes/__init__.py,
cubicweb/devtools/test/data/schema.py,
cubicweb/devtools/testlib.py,
cubicweb/devtools/test/unittest_devctl.py,
cubicweb/devtools/test/unittest_i18n.py,
cubicweb/devtools/test/unittest_webtest.py,
cubicweb/devtools/webtest.py,
cubicweb/entities/adapters.py,
cubicweb/entities/test/unittest_base.py,
cubicweb/etwist/__init__.py,
cubicweb/ext/__init__.py,
cubicweb/hooks/test/data/hooks.py,
cubicweb/hooks/test/unittest_notification.py,
cubicweb/hooks/test/unittest_security.py,
cubicweb/hooks/test/unittest_syncsession.py,
cubicweb/__init__.py,
cubicweb/__main__.py,
cubicweb/pylintext.py,
cubicweb/server/repository.py,
cubicweb/server/schema2sql.py,
cubicweb/server/session.py,
cubicweb/server/sqlutils.py,
cubicweb/server/test/datacomputed/migratedapp/schema.py,
cubicweb/server/test/datacomputed/schema.py,
cubicweb/server/test/data/entities.py,
cubicweb/server/test/data-migractions/cubes/fakecustomtype/__init__.py,
cubicweb/server/test/data-migractions/cubes/fakeemail/__init__.py,
cubicweb/server/test/data-migractions/cubes/__init__.py,
cubicweb/server/test/data-migractions/migratedapp/__init__.py,
cubicweb/server/test/data-schema2sql/__init__.py,
cubicweb/server/test/unittest_checkintegrity.py,
cubicweb/server/test/unittest_ldapsource.py,
cubicweb/skeleton/test/pytestconf.py,
cubicweb/sobjects/test/unittest_notification.py,
cubicweb/sobjects/test/unittest_register_user.py,
cubicweb/sobjects/textparsers.py,
cubicweb/test/data/cubes/comment/__init__.py,
cubicweb/test/data/cubes/comment/__pkginfo__.py,
cubicweb/test/data/cubes/email/entities.py,
cubicweb/test/data/cubes/email/hooks.py,
cubicweb/test/data/cubes/email/__init__.py,
cubicweb/test/data/cubes/email/__pkginfo__.py,
cubicweb/test/data/cubes/email/views/__init__.py,
cubicweb/test/data/cubes/file/entities/__init__.py,
cubicweb/test/data/cubes/file/hooks/__init__.py,
cubicweb/test/data/cubes/file/__init__.py,
cubicweb/test/data/cubes/file/__pkginfo__.py,
cubicweb/test/data/cubes/file/views.py,
cubicweb/test/data/cubes/forge/__init__.py,
cubicweb/test/data/cubes/forge/__pkginfo__.py,
cubicweb/test/data/cubes/mycube/__init__.py,
cubicweb/test/data/cubes/mycube/__pkginfo__.py,
cubicweb/test/data/migration/0.1.0_common.py,
cubicweb/test/data/migration/0.1.0_repository.py,
cubicweb/test/data_schemareader/schema.py,
cubicweb/test/data/server_migration/bootstrapmigration_repository.py,
cubicweb/test/data/views.py,
cubicweb/test/unittest_binary.py,
cubicweb/test/unittest_mail.py,
cubicweb/test/unittest_repoapi.py,
cubicweb/test/unittest_schema.py,
cubicweb/test/unittest_toolsutils.py,
cubicweb/web/formwidgets.py,
cubicweb/web/test/data/entities.py,
cubicweb/web/test/unittest_http_headers.py,
cubicweb/web/test/unittest_views_basetemplates.py,
cubicweb/web/test/unittest_views_cwsources.py,
cubicweb/web/test/unittest_views_json.py,
cubicweb/web/views/json.py,
cubicweb/web/views/searchrestriction.py,
cubicweb/xy.py,
# vim: wrap sts=2 sw=2