From 793180533e4f19b364145c61939d6cad07dd851a Mon Sep 17 00:00:00 2001 From: drebs Date: Sun, 24 Jul 2016 07:56:52 -0300 Subject: [test] add pytest initial setup for performance tests --- testing/tox.ini | 3 +++ 1 file changed, 3 insertions(+) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 3663eef3..caeb52c1 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -8,16 +8,19 @@ deps = pytest pytest-flake8 pytest-pep8 + pytest-twisted mock testscenarios setuptools-trial pep8 pdbpp couchdb + requests # install soledad local packages -e../common -e../client -e../server setenv = HOME=/tmp + TERM=xterm install_command = pip install {opts} {packages} -- cgit v1.2.3 From 259b5fa06bb83c8d9cbb53e43efd18ac9a9730f4 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 09:37:02 -0300 Subject: [test] remove pep8 from tox config --- testing/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index caeb52c1..c3126cf2 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -2,7 +2,7 @@ envlist = py27 [testenv] -commands = py.test --pep8 {posargs} +commands = py.test {posargs} changedir = tests deps = pytest -- cgit v1.2.3 From 92813593b93d9788fd978acdeeba59d32c311d48 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 25 Jul 2016 21:25:46 -0300 Subject: [test] use pip download cache for tests and docker image --- testing/tox.ini | 1 + 1 file changed, 1 insertion(+) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index c3126cf2..5f401a35 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -23,4 +23,5 @@ deps = setenv = HOME=/tmp TERM=xterm + PIP_DOWNLOAD_CACHE=/var/cache/pip install_command = pip install {opts} {packages} -- cgit v1.2.3 From 06d0157728f5f8f273e4c83d42bf5b92784734c7 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 29 Jul 2016 20:14:28 -0300 Subject: [test] remove pip download cache Recent versions of pip will ignore that option and use a cache anyway. --- testing/tox.ini | 1 - 1 file changed, 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 5f401a35..c3126cf2 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -23,5 +23,4 @@ deps = setenv = HOME=/tmp TERM=xterm - PIP_DOWNLOAD_CACHE=/var/cache/pip install_command = pip install {opts} {packages} -- cgit v1.2.3 From c11478c65856a2a607ed538b6dbb9873a2b0963c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 1 Aug 2016 19:00:45 -0300 Subject: [test] adds pep8 as a tox env "tox -e pep8" runs it standalone and "tox" includes the pep8 env. --- testing/tox.ini | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index c3126cf2..246f63fa 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -1,13 +1,11 @@ [tox] -envlist = py27 +envlist = py27,pep8 [testenv] commands = py.test {posargs} changedir = tests deps = pytest - pytest-flake8 - pytest-pep8 pytest-twisted mock testscenarios @@ -24,3 +22,8 @@ setenv = HOME=/tmp TERM=xterm install_command = pip install {opts} {packages} + +[testenv:pep8] +changedir = .. +deps = pep8 +commands = pep8 {posargs} client server common -- cgit v1.2.3 From 4c2be2af0c328d4d413e8f26a9056d2102e94ea9 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 1 Aug 2016 19:42:49 -0300 Subject: [test] adds optional parallel env for local dev --- testing/tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 246f63fa..83793cc7 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -27,3 +27,10 @@ install_command = pip install {opts} {packages} changedir = .. deps = pep8 commands = pep8 {posargs} client server common + +[testenv:parallel] +deps = + {[testenv]deps} + pytest-xdist +install_command = pip install {opts} {packages} +commands = py.test {posargs} -n 4 -- cgit v1.2.3 From e315847bd06bb575505720bd7e882e07406b1fab Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 1 Aug 2016 21:12:58 -0300 Subject: [test] do not run pep8 tox env by default --- testing/tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 83793cc7..a25bc1e6 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,pep8 +envlist = py27 [testenv] commands = py.test {posargs} @@ -10,7 +10,6 @@ deps = mock testscenarios setuptools-trial - pep8 pdbpp couchdb requests -- cgit v1.2.3 From 29f528927322bb8e3ca326399367c33225b492b5 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 15 Aug 2016 20:39:06 -0300 Subject: [test] allow for shell autocomplete for test names tox was configured to change to the testing/tests directory before executing pytest, by using tox's "changedir" configuration option. The reason why this was the case is that we wanted to discover tests inside the testing/tests directory only. The problem with that approach is that if we wanted to point to a specific test file, for example "tests/perf/test_sync.py", we would have to omit the "tests" part and write "tox perf/test_sync.py" because the argument would be understood as relative to the changed dir. That is not practical as doesn't allow to use the shell autocomplete, and is also not the only way to achieve what we want. Actually, pytest has a configuration option called "testpaths" where you can indicate where it should discover tests. This commit changes one approach by the other and allows to user shell autocomplete for easyness of testing during development. --- testing/tox.ini | 1 - 1 file changed, 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index a25bc1e6..a7d62189 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -3,7 +3,6 @@ envlist = py27 [testenv] commands = py.test {posargs} -changedir = tests deps = pytest pytest-twisted -- cgit v1.2.3 From f0f3e0358a01708eb048d8eaf463361e682be466 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 9 Aug 2016 21:08:13 -0300 Subject: [test] Adds pytest-benchmark adapted to Twisted Adapted pytest-benchmark to Twisted as it's synchronous and added fixtures for benchmarking. --- testing/tox.ini | 1 + 1 file changed, 1 insertion(+) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index a7d62189..c1d7ddb7 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -6,6 +6,7 @@ commands = py.test {posargs} deps = pytest pytest-twisted + pytest-benchmark mock testscenarios setuptools-trial -- cgit v1.2.3 From 60fb1e6554775d1b22685f5b1eea04795c84a542 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 2 Sep 2016 16:12:43 -0400 Subject: [tests] add pep8 in main tox run from within the gitlab script add coverage reports too. (hereby we swear not to write stupid tests just because it feels good to have an increased coverage metric). - Resolves: #8416 --- testing/tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index c1d7ddb7..fecd4c5b 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -2,9 +2,14 @@ envlist = py27 [testenv] -commands = py.test {posargs} +commands = py.test --cov-report=html \ + --cov-report=term \ + --cov=leap.soledad \ + {posargs} deps = + coverage pytest + pytest-cov pytest-twisted pytest-benchmark mock -- cgit v1.2.3 From bf21811b18dad6f562357037ae3d335ac59b5746 Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 6 Sep 2016 12:11:21 -0300 Subject: [test] add tox env for perf tests --- testing/tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index fecd4c5b..88ca9fcc 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -11,7 +11,6 @@ deps = pytest pytest-cov pytest-twisted - pytest-benchmark mock testscenarios setuptools-trial @@ -27,6 +26,12 @@ setenv = TERM=xterm install_command = pip install {opts} {packages} +[testenv:perf] +deps = + {[testenv]deps} + pytest-benchmark +commands = py.test tests/perf {posargs} + [testenv:pep8] changedir = .. deps = pep8 -- cgit v1.2.3 From a7ffb49e1169c93af3b728f5db1a5e16e6231590 Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 8 Sep 2016 12:44:53 -0300 Subject: [test] add tagged perf job for gitlab-ci In order to configure performance tests to run in a specific machine we need to add a tagged job to .gitlab-ci.yml file. That job will only execute the perf tests, and then we can have runners that will only run those jobs. --- testing/tox.ini | 1 + 1 file changed, 1 insertion(+) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 88ca9fcc..231b2a9a 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -30,6 +30,7 @@ install_command = pip install {opts} {packages} deps = {[testenv]deps} pytest-benchmark +basepython = python2.7 commands = py.test tests/perf {posargs} [testenv:pep8] -- cgit v1.2.3 From 887fd917a19654aa6a7c6c54be3f22c3b6c79b92 Mon Sep 17 00:00:00 2001 From: drebs Date: Sat, 24 Sep 2016 15:57:54 -0300 Subject: [test] add flake8 code check and generalize name of tox env --- testing/tox.ini | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 231b2a9a..820d958c 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -33,10 +33,14 @@ deps = basepython = python2.7 commands = py.test tests/perf {posargs} -[testenv:pep8] +[testenv:code-check] changedir = .. -deps = pep8 -commands = pep8 {posargs} client server common +deps = + pep8 + flake8 +commands = + pep8 client server common + flake8 --ignore=F812,E731 client server common [testenv:parallel] deps = -- cgit v1.2.3 From 28eb55c8388fa0dd713471d1c3334ef4ccb49ae4 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 3 Oct 2016 15:23:19 -0300 Subject: [tests] specify basepython on root env code-check is running with py3 randomly on CI, this commit should pin it. --- testing/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing/tox.ini') diff --git a/testing/tox.ini b/testing/tox.ini index 820d958c..31cb8a4f 100644 --- a/testing/tox.ini +++ b/testing/tox.ini @@ -2,6 +2,7 @@ envlist = py27 [testenv] +basepython = python2.7 commands = py.test --cov-report=html \ --cov-report=term \ --cov=leap.soledad \ @@ -30,7 +31,6 @@ install_command = pip install {opts} {packages} deps = {[testenv]deps} pytest-benchmark -basepython = python2.7 commands = py.test tests/perf {posargs} [testenv:code-check] -- cgit v1.2.3