diff --git a/.circleci/config.yml b/.circleci/config.yml index a4946168..ead8c04f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,6 @@ jobs: - image: circleci/mariadb:10.1-ram - image: circleci/redis:5.0.4 - image: rabbitmq:3.5.4 - - image: couchbase/server-sandbox:5.5.0 - image: circleci/mongo:4.2.3-ram working_directory: ~/repo steps: @@ -19,12 +18,6 @@ jobs: - run: name: install dependencies command: | - sudo apt-get update - sudo apt install lsb-release -y - curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb - sudo dpkg -i ./couchbase-release-1.0-6-amd64.deb - sudo apt-get update - sudo apt install libcouchbase-dev -y rm -rf venv export PATH=/home/circleci/.local/bin:$PATH pip install --user -U pip setuptools virtualenv @@ -36,7 +29,7 @@ jobs: - run: name: run tests environment: - INSTANA_TEST: true + INSTANA_TEST: "true" command: | . venv/bin/activate pytest -v @@ -48,9 +41,31 @@ jobs: - image: circleci/mariadb:10-ram - image: circleci/redis:5.0.4 - image: rabbitmq:3.5.4 - - image: couchbase/server-sandbox:5.5.0 - image: circleci/mongo:4.2.3-ram working_directory: ~/repo + steps: + - checkout + - run: + name: install dependencies + command: | + python -m venv venv + . venv/bin/activate + pip install -U pip + python setup.py install_egg_info + pip install -e '.[test]' + - run: + name: run tests + environment: + INSTANA_TEST: "true" + command: | + . venv/bin/activate + pytest -v + + py38couchbase: + docker: + - image: circleci/python:3.7.8-stretch + - image: couchbase/server-sandbox:5.5.0 + working_directory: ~/repo steps: - checkout - run: @@ -66,14 +81,45 @@ jobs: . venv/bin/activate pip install -U pip python setup.py install_egg_info - pip install -e '.[test]' + pip install -e '.[test-couchbase]' - run: name: run tests environment: - INSTANA_TEST: true + INSTANA_TEST: "true" + COUCHBASE_TEST: "true" command: | . venv/bin/activate - pytest -v + pytest -v tests/clients/test_couchbase.py + + py27couchbase: + docker: + - image: circleci/python:2.7.16-stretch + - image: couchbase/server-sandbox:5.5.0 + working_directory: ~/repo + steps: + - checkout + - run: + name: install dependencies + command: | + sudo apt-get update + sudo apt install lsb-release -y + curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb + sudo dpkg -i ./couchbase-release-1.0-6-amd64.deb + sudo apt-get update + sudo apt install libcouchbase-dev -y + python -m venv venv + . venv/bin/activate + pip install -U pip + python setup.py install_egg_info + pip install -e '.[test-couchbase]' + - run: + name: run tests + environment: + INSTANA_TEST: "true" + COUCHBASE_TEST: "true" + command: | + . venv/bin/activate + pytest -v tests/clients/test_couchbase.py py27cassandra: docker: @@ -99,8 +145,8 @@ jobs: - run: name: run tests environment: - INSTANA_TEST: true - CASSANDRA_TEST: true + INSTANA_TEST: "true" + CASSANDRA_TEST: "true" command: | . venv/bin/activate pytest -v tests/clients/test_cassandra-driver.py @@ -126,8 +172,8 @@ jobs: - run: name: run tests environment: - INSTANA_TEST: true - CASSANDRA_TEST: true + INSTANA_TEST: "true" + CASSANDRA_TEST: "true" command: | . venv/bin/activate pytest -v tests/clients/test_cassandra-driver.py @@ -149,8 +195,8 @@ jobs: - run: name: run tests environment: - INSTANA_TEST: true - GEVENT_TEST: true + INSTANA_TEST: "true" + GEVENT_TEST: "true" command: | . venv/bin/activate pytest -v tests/frameworks/test_gevent.py diff --git a/runtests.py b/runtests.py deleted file mode 100644 index 5ac9effd..00000000 --- a/runtests.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import sys -import nose -from distutils.version import LooseVersion - -os.environ['INSTANA_TEST'] = "true" -command_line = [__file__, '--verbose'] - -# Cassandra and gevent tests are run in dedicated jobs on CircleCI and will -# be run explicitly. (So always exclude them here) -command_line.extend(['-e', 'cassandra', '-e', 'gevent']) - -if LooseVersion(sys.version) < LooseVersion('3.5.3'): - command_line.extend(['-e', 'asynqp', '-e', 'aiohttp', - '-e', 'async', '-e', 'tornado', - '-e', 'grpcio']) - -if LooseVersion(sys.version) >= LooseVersion('3.7.0'): - command_line.extend(['-e', 'sudsjurko']) - -command_line.extend(sys.argv[1:]) - -print("Nose arguments: %s" % command_line) -result = nose.main(argv=command_line) - -exit(result) diff --git a/setup.py b/setup.py index 636f5b7f..30265cb0 100644 --- a/setup.py +++ b/setup.py @@ -83,11 +83,13 @@ def check_setuptools(): 'pytest>=4.6', 'urllib3[secure]>=1.15' ], + 'test-couchbase': [ + 'couchbase==2.5.9', + ], 'test': [ 'aiohttp>=3.5.4;python_version>="3.5"', 'asynqp>=0.4;python_version>="3.5"', 'celery>=4.1.1', - 'couchbase==2.5.9', 'django>=1.11,<2.2', 'nose>=1.0', 'flask>=0.12.2', diff --git a/tests/clients/test_couchbase.py b/tests/clients/test_couchbase.py index 5f7f17d7..6cf815ed 100644 --- a/tests/clients/test_couchbase.py +++ b/tests/clients/test_couchbase.py @@ -25,7 +25,7 @@ pass -@pytest.mark.skip(reason='Unstable tests') +@pytest.mark.skipif("COUCHBASE_TEST" not in os.environ, reason="") class TestStandardCouchDB(unittest.TestCase): def setup_class(self): """ Clear all spans before a test run """ diff --git a/tests/conftest.py b/tests/conftest.py index dc139416..88ce0cfd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,6 +11,9 @@ if "CASSANDRA_TEST" not in os.environ: collect_ignore_glob.append("*test_cassandra*") +if "COUCHBASE_TEST" not in os.environ: + collect_ignore_glob.append("*test_couchbase*") + if "GEVENT_TEST" not in os.environ: collect_ignore_glob.append("*test_gevent*")