[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.
--- a/MANIFEST.in Thu May 26 15:38:39 2016 +0200
+++ b/MANIFEST.in Fri Sep 23 16:04:32 2016 +0200
@@ -34,39 +34,30 @@
recursive-include cubicweb/i18n *.pot *.po
recursive-include cubicweb/schemas *.py *.sql
-include dev-requirements.txt
-include cubicweb/test/requirements.txt
+recursive-include requirements *.txt
+
recursive-include cubicweb/test/data bootstrap_cubes *.py *.sql
recursive-include cubicweb/test/data-rewrite bootstrap_cubes *.py
recursive-include cubicweb/test/data_schemareader *.py
recursive-include cubicweb/dataimport/test/data *.py *.csv *.txt
recursive-include cubicweb/dataimport/test/data-massimport *.py
-include cubicweb/devtools/test/requirements.txt
recursive-include cubicweb/devtools/test/data bootstrap_cubes *.py *.txt *.js *.po.ref
-include cubicweb/entities/test/requirements.txt
recursive-include cubicweb/entities/test/data bootstrap_cubes *.py
-include cubicweb/etwist/test/requirements.txt
recursive-include cubicweb/etwist/test/data *.py
-include cubicweb/ext/test/requirements.txt
recursive-include cubicweb/ext/test/data *.py
-include cubicweb/hooks/test/requirements.txt
recursive-include cubicweb/hooks/test/data-computed *.py
recursive-include cubicweb/hooks/test/data bootstrap_cubes *.py
-include cubicweb/sobjects/test/requirements.txt
recursive-include cubicweb/sobjects/test/data bootstrap_cubes *.py
-include cubicweb/server/test/requirements.txt
recursive-include cubicweb/server/test/data bootstrap_cubes *.py source* *.conf.in *.ldif
recursive-include cubicweb/server/test/data-cwep002 *.py
recursive-include cubicweb/server/test/datacomputed *.py
recursive-include cubicweb/server/test/data-schema2sql bootstrap_cubes toignore
recursive-include cubicweb/server/test/data-migractions bootstrap_cubes *.py
recursive-include cubicweb/server/test/data-schemaserial *.py
-include cubicweb/web/test/requirements.txt
include cubicweb/web/test/testutils.js
recursive-include cubicweb/web/test/data bootstrap_cubes pouet.css *.py
recursive-include cubicweb/web/test/data/static/jstests *.js *.html *.css *.json
recursive-include cubicweb/web/test/windmill *.py
-include cubicweb/wsgi/test/requirements.txt
include cubicweb/web/data/jquery-treeview/*.md
--- a/cubicweb/devtools/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-Twisted < 16.0.0
-webtest
-flake8
--- a/cubicweb/entities/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-docutils
--- a/cubicweb/etwist/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Twisted < 16.0.0
--- a/cubicweb/ext/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-docutils
--- a/cubicweb/hooks/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-psycopg2
--- a/cubicweb/hooks/test/unittest_notification.py Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-# copyright 2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
-# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
-#
-# This file is part of CubicWeb.
-#
-# CubicWeb is free software: you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation, either version 2.1 of the License, or (at your option)
-# any later version.
-#
-# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License along
-# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
-"""tests for notification hooks"""
-
-from cubicweb.devtools.testlib import CubicWebTC
-
-
-class NotificationHooksTC(CubicWebTC):
-
- def test_entity_update(self):
- """Check transaction_data['changes'] filled by "notifentityupdated" hook.
- """
- with self.admin_access.repo_cnx() as cnx:
- root = cnx.create_entity('Folder', name=u'a')
- cnx.commit()
- root.cw_set(name=u'b')
- self.assertIn('changes', cnx.transaction_data)
- self.assertEqual(cnx.transaction_data['changes'],
- {root.eid: set([('name', u'a', u'b')])})
-
-
-if __name__ == '__main__':
- from logilab.common.testlib import unittest_main
- unittest_main()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/hooks/test/unittest_notificationhooks.py Fri Sep 23 16:04:32 2016 +0200
@@ -0,0 +1,39 @@
+# copyright 2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
+#
+# This file is part of CubicWeb.
+#
+# CubicWeb is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 2.1 of the License, or (at your option)
+# any later version.
+#
+# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License along
+# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
+"""tests for notification hooks"""
+
+from cubicweb.devtools.testlib import CubicWebTC
+
+
+class NotificationHooksTC(CubicWebTC):
+
+ def test_entity_update(self):
+ """Check transaction_data['changes'] filled by "notifentityupdated" hook.
+ """
+ with self.admin_access.repo_cnx() as cnx:
+ root = cnx.create_entity('Folder', name=u'a')
+ cnx.commit()
+ root.cw_set(name=u'b')
+ self.assertIn('changes', cnx.transaction_data)
+ self.assertEqual(cnx.transaction_data['changes'],
+ {root.eid: set([('name', u'a', u'b')])})
+
+
+if __name__ == '__main__':
+ from logilab.common.testlib import unittest_main
+ unittest_main()
--- a/cubicweb/server/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-psycopg2
-ldap3
-cubicweb-basket
-cubicweb-card
-cubicweb-comment
-cubicweb-file
-cubicweb-localperms
-cubicweb-tag
--- a/cubicweb/sobjects/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-cubicweb-card
-cubicweb-comment
--- a/cubicweb/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-Pygments
-mock
-#fyzz XXX pip install fails
-cubicweb-card
-cubicweb-file
-cubicweb-localperms
-cubicweb-tag
--- a/cubicweb/test/unittest_cwconfig.py Thu May 26 15:38:39 2016 +0200
+++ b/cubicweb/test/unittest_cwconfig.py Fri Sep 23 16:04:32 2016 +0200
@@ -79,7 +79,7 @@
@patch('pkg_resources.iter_entry_points', side_effect=iter_entry_points)
def test_available_cubes(self, mock_iter_entry_points):
expected_cubes = [
- 'card', 'cubicweb_comment', 'cubicweb_email', 'file',
+ 'card', 'comment', 'cubicweb_comment', 'cubicweb_email', 'file',
'cubicweb_file', 'cubicweb_forge', 'localperms',
'cubicweb_mycube', 'tag',
]
--- a/cubicweb/web/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-requests
-webtest
-Twisted < 16.0.0
-cubicweb-blog
-cubicweb-file
-cubicweb-tag
--- a/cubicweb/wsgi/test/requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-webtest
--- a/dev-requirements.txt Thu May 26 15:38:39 2016 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-pytest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/requirements/dev.txt Fri Sep 23 16:04:32 2016 +0200
@@ -0,0 +1,1 @@
+pytest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/requirements/test-misc.txt Fri Sep 23 16:04:32 2016 +0200
@@ -0,0 +1,24 @@
+### Requirements for tests in various cubicweb/**/test directories. ###
+
+## shared by several test folders
+cubicweb-card
+docutils
+Twisted < 16.0.0
+webtest
+
+## cubicweb/test
+Pygments
+mock
+#fyzz XXX pip install fails
+cubicweb-file
+cubicweb-localperms
+cubicweb-tag
+
+## cubicweb/devtools/test
+flake8
+
+## cubicweb/hooks/test
+psycopg2
+
+## cubicweb/sobject/test
+cubicweb-comment
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/requirements/test-server.txt Fri Sep 23 16:04:32 2016 +0200
@@ -0,0 +1,8 @@
+psycopg2
+ldap3
+cubicweb-basket
+cubicweb-card
+cubicweb-comment
+cubicweb-file
+cubicweb-localperms
+cubicweb-tag
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/requirements/test-web.txt Fri Sep 23 16:04:32 2016 +0200
@@ -0,0 +1,6 @@
+Twisted < 16.0.0
+requests
+webtest
+cubicweb-blog
+cubicweb-file
+cubicweb-tag
--- a/tox.ini Thu May 26 15:38:39 2016 +0200
+++ b/tox.ini Fri Sep 23 16:04:32 2016 +0200
@@ -1,45 +1,24 @@
[tox]
envlist =
check-manifest,flake8,
- py27-{cubicweb,dataimport,devtools,entities,etwist,ext,hooks,server,migractions,sobjects,web,wsgi},
- py34-{cubicweb,dataimport,devtools,entities,ext,hooks,server,migractions,sobjects,web,wsgi}
+ py{27,34}-{server,web,misc}
[testenv]
sitepackages = True
whitelist_externals =
/usr/bin/touch
deps =
- -rdev-requirements.txt
- cubicweb: -r{toxinidir}/cubicweb/test/requirements.txt
- devtools: -r{toxinidir}/cubicweb/devtools/test/requirements.txt
- entities: -r{toxinidir}/cubicweb/entities/test/requirements.txt
- etwist: -r{toxinidir}/cubicweb/etwist/test/requirements.txt
- ext: -r{toxinidir}/cubicweb/ext/test/requirements.txt
- hooks: -r{toxinidir}/cubicweb/hooks/test/requirements.txt
- server: -r{toxinidir}/cubicweb/server/test/requirements.txt
- migractions: -r{toxinidir}/cubicweb/server/test/requirements.txt
- sobjects: -r{toxinidir}/cubicweb/sobjects/test/requirements.txt
- web: -r{toxinidir}/cubicweb/web/test/requirements.txt
- wsgi: -r{toxinidir}/cubicweb/wsgi/test/requirements.txt
+ -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-cubicweb: touch {envdir}/share/cubicweb/cubes/__init__.py
- py34-server: touch {envdir}/share/cubicweb/cubes/__init__.py
- py34-migractions: touch {envdir}/share/cubicweb/cubes/__init__.py
- py34-sobjects: touch {envdir}/share/cubicweb/cubes/__init__.py
- py34-web: touch {envdir}/share/cubicweb/cubes/__init__.py
- cubicweb: {envpython} -m pip install --upgrade --no-deps --quiet git+git://github.com/logilab/yapps@master#egg=yapps
- cubicweb: {envpython} -m pytest {toxinidir}/cubicweb/test {posargs}
- dataimport: {envpython} -m pytest {toxinidir}/cubicweb/dataimport/test {posargs}
- devtools: {envpython} -m pytest {toxinidir}/cubicweb/devtools/test {posargs}
- entities: {envpython} -m pytest {toxinidir}/cubicweb/entities/test {posargs}
- etwist: {envpython} -m pytest {toxinidir}/cubicweb/etwist/test {posargs}
- ext: {envpython} -m pytest {toxinidir}/cubicweb/ext/test {posargs}
- hooks: {envpython} -m pytest {toxinidir}/cubicweb/hooks/test {posargs}
- server: {envpython} -m pytest {toxinidir}/cubicweb/server/test {posargs} --ignore={toxinidir}/cubicweb/server/test/unittest_migractions.py
- migractions: {envpython} -m pytest {toxinidir}/cubicweb/server/test/unittest_migractions.py {posargs}
- sobjects: {envpython} -m pytest {toxinidir}/cubicweb/sobjects/test {posargs}
- web: {envpython} -m pytest {toxinidir}/cubicweb/web/test {posargs}
- wsgi: {envpython} -m pytest {toxinidir}/cubicweb/wsgi/test {posargs}
+ 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
@@ -160,3 +139,5 @@
cubicweb/web/views/json.py,
cubicweb/web/views/searchrestriction.py,
cubicweb/xy.py,
+
+# vim: wrap sts=2 sw=2