summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-11-17 22:14:51 -0200
committerdrebs <drebs@leap.se>2016-12-12 09:13:09 -0200
commit5294f5b9ae01429e6d0ee75c8dc98441ba760845 (patch)
treec61a11b22a8b1c9d51d1aabc79113b32c123fba8
parent3e74de6208c22643b1c063b70d22d352c0409703 (diff)
[test] use tags for selecting benchmark tests
-rw-r--r--testing/pytest.ini1
-rw-r--r--testing/tests/perf/conftest.py3
-rw-r--r--testing/tests/perf/test_crypto.py3
-rw-r--r--testing/tests/perf/test_misc.py2
-rw-r--r--testing/tests/perf/test_sqlcipher.py2
-rw-r--r--testing/tests/perf/test_sync.py2
-rw-r--r--testing/tox.ini9
7 files changed, 14 insertions, 8 deletions
diff --git a/testing/pytest.ini b/testing/pytest.ini
index 39d1e1c6..eb70b67c 100644
--- a/testing/pytest.ini
+++ b/testing/pytest.ini
@@ -1,4 +1,3 @@
[pytest]
testpaths = tests
-norecursedirs = tests/perf
twisted = yes
diff --git a/testing/tests/perf/conftest.py b/testing/tests/perf/conftest.py
index 2964936b..d08ea61d 100644
--- a/testing/tests/perf/conftest.py
+++ b/testing/tests/perf/conftest.py
@@ -26,9 +26,6 @@ server.ensure_server()
def pytest_addoption(parser):
parser.addoption(
- "--couch-url", type="string", default="http://127.0.0.1:5984",
- help="the url for the couch server to be used during tests")
- parser.addoption(
"--num-docs", type="int", default=100,
help="the number of documents to use in performance tests")
diff --git a/testing/tests/perf/test_crypto.py b/testing/tests/perf/test_crypto.py
index 367c3b5b..a438ee49 100644
--- a/testing/tests/perf/test_crypto.py
+++ b/testing/tests/perf/test_crypto.py
@@ -18,6 +18,9 @@ from leap.soledad.client import _crypto
LIMIT = int(float(os.environ.get('SIZE_LIMIT', 50 * 1000 * 1000)))
+pytestmark = pytest.mark.perf
+
+
def create_doc_encryption(size):
@pytest.mark.benchmark(group="test_crypto_encrypt_doc")
def test_doc_encryption(soledad_client, benchmark, payload):
diff --git a/testing/tests/perf/test_misc.py b/testing/tests/perf/test_misc.py
index ead48adf..b45dc04e 100644
--- a/testing/tests/perf/test_misc.py
+++ b/testing/tests/perf/test_misc.py
@@ -1,5 +1,7 @@
import pytest
+pytestmark = pytest.mark.perf
+
@pytest.mark.benchmark(group="test_instance")
def test_initialization(soledad_client, benchmark):
diff --git a/testing/tests/perf/test_sqlcipher.py b/testing/tests/perf/test_sqlcipher.py
index 39c9e3ad..807af6e9 100644
--- a/testing/tests/perf/test_sqlcipher.py
+++ b/testing/tests/perf/test_sqlcipher.py
@@ -5,6 +5,8 @@ import pytest
from twisted.internet.defer import gatherResults
+pytestmark = pytest.mark.perf
+
def load_up(client, amount, payload, defer=True):
results = [client.create_doc({'content': payload}) for _ in xrange(amount)]
diff --git a/testing/tests/perf/test_sync.py b/testing/tests/perf/test_sync.py
index 1bf6cc21..9bb20389 100644
--- a/testing/tests/perf/test_sync.py
+++ b/testing/tests/perf/test_sync.py
@@ -1,5 +1,7 @@
import pytest
+pytestmark = pytest.mark.perf
+
@pytest.inlineCallbacks
def load_up(client, amount, payload):
diff --git a/testing/tox.ini b/testing/tox.ini
index d84566ca..f6470c89 100644
--- a/testing/tox.ini
+++ b/testing/tox.ini
@@ -4,10 +4,11 @@ skipsdist=True
[testenv]
basepython = python2.7
-commands = py.test --cov-report=html \
+commands = py.test -m "not perf" \
+ --cov-report=html \
--cov-report=term \
- --cov=leap.soledad \
- {posargs}
+ --cov=leap.soledad \
+ {posargs}
usedevelop = True
deps =
coverage
@@ -34,7 +35,7 @@ install_command = pip install {opts} {packages}
deps =
{[testenv]deps}
pytest-benchmark
-commands = py.test tests/perf {posargs}
+commands = py.test -m perf {posargs}
[testenv:code-check]
changedir = ..