From b3a7db605bd94ad65e8db4c75ca256a3711a51f6 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 25 Aug 2020 16:50:31 +0200 Subject: [PATCH 1/5] Couchbase: Change to dedicated tests --- .circleci/config.yml | 80 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4946168..167dcaab 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: @@ -70,10 +85,39 @@ jobs: - run: name: run tests environment: - INSTANA_TEST: true + INSTANA_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]' + - run: + name: run tests + environment: + INSTANA_TEST: "true" + command: | + . venv/bin/activate + pytest -v tests/clients/test_couchbase.py py27cassandra: docker: @@ -99,8 +143,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 +170,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 +193,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 @@ -162,4 +206,6 @@ workflows: - python38 - py27cassandra - py36cassandra + - py27couchbase + - py38couchbase - gevent38 From c7cfbdf6fb37205e16053d4f6324746ddb15d637 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 25 Aug 2020 17:03:26 +0200 Subject: [PATCH 2/5] Separated test extra --- .circleci/config.yml | 4 ++-- setup.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 167dcaab..1cc5df2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ 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: @@ -110,7 +110,7 @@ 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: 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', From 66b4252c8bd937ef1667cf24d9a3f50297ac1542 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 25 Aug 2020 17:12:26 +0200 Subject: [PATCH 3/5] Use env var to mark test --- .circleci/config.yml | 2 ++ runtests.py | 26 -------------------------- tests/clients/test_couchbase.py | 2 +- 3 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 runtests.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 1cc5df2d..c3086bac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,7 @@ jobs: name: run tests environment: INSTANA_TEST: "true" + COUCHBASE_TEST: "true" command: | . venv/bin/activate pytest -v tests/clients/test_couchbase.py @@ -115,6 +116,7 @@ jobs: name: run tests environment: INSTANA_TEST: "true" + COUCHBASE_TEST: "true" command: | . venv/bin/activate pytest -v tests/clients/test_couchbase.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/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 """ From 712b6a4e2ede8c28e3928a4c3bfe3394b9f2d9c0 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 25 Aug 2020 17:22:38 +0200 Subject: [PATCH 4/5] Run couchbase tests in couchbase workflow --- tests/conftest.py | 3 +++ 1 file changed, 3 insertions(+) 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*") From 5287cfa7295c0d547767ad734d579d80882acb24 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 25 Aug 2020 17:30:04 +0200 Subject: [PATCH 5/5] Skip couchbase tests until upstream packages are fixed --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3086bac..ead8c04f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -208,6 +208,4 @@ workflows: - python38 - py27cassandra - py36cassandra - - py27couchbase - - py38couchbase - gevent38