From 3a49a6b23e4f04183c6757432f69e0b6ab7512f2 Mon Sep 17 00:00:00 2001 From: Jim Fulton Date: Tue, 14 Jun 2016 13:43:36 -0400 Subject: [PATCH] Updated the buildout configuration to just run relstorage tests and to select which databases to use at build time. --- BUILDOUT.rst | 18 ++++++++++++++++++ CHANGES.txt | 3 +++ buildout.cfg | 14 +++++++------- setup.py | 8 ++++---- 4 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 BUILDOUT.rst diff --git a/BUILDOUT.rst b/BUILDOUT.rst new file mode 100644 index 0000000..38bce3f --- /dev/null +++ b/BUILDOUT.rst @@ -0,0 +1,18 @@ +======================================== +Building for running tests with buildout +======================================== + +Run the buildout as usual, but to include database support specify a +db option, with one or more database names sperated by commas. For +example, to build for postgres, mysql and oracle:: + + bin/buildout db=postgresql,mysql,oracle + +Or just postgres: + + bin/buildout db=postgresql + +Before running tests, you'll need to run database setup scripts in the +``.travis`` subdirectory. + +Then run tests with ``bin/test``. diff --git a/CHANGES.txt b/CHANGES.txt index 2a8e917..8d7ca8e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,9 @@ psycopg2cffi respectively. PyPy can be substantially faster than CPython in some scenarios; see `PR 23`_. +- Updated the buildout configuration to just run relstorage tests and + to select which databases to use at build time. + .. _`PR 23`: https://github.com/zodb/relstorage/pull/23/ 1.6.0b3 (2014-12-08) diff --git a/buildout.cfg b/buildout.cfg index 095e5b0..9d9d56f 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -1,17 +1,17 @@ [buildout] develop = . -base-parts = test python omelette coverage-test coverage-report +base-parts = test py python omelette coverage-test coverage-report parts = ${buildout:base-parts} eggs = relstorage - psycopg2 - MySQL-python - ZODB3 [test] - zope.testrunner - mock +db = [test] recipe = zc.recipe.testrunner -eggs = ${buildout:eggs} +eggs = relstorage [test, ${buildout:db}] + +[py] +recipe = zc.recipe.egg +eggs = ${test:eggs} [python] recipe = zc.recipe.egg diff --git a/setup.py b/setup.py index 43784c7..4d6c173 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,8 @@ def read_file(*path): result = f.read() return result +tests_require = ['mock', 'zope.testing', 'ZODB [test]'] + setup( name="RelStorage", version=VERSION, @@ -80,10 +82,7 @@ setup( 'zope.interface', 'zc.lockfile', ], - tests_require=[ - 'mock', - 'zope.testing', - ], + tests_require = tests_require, extras_require={ 'mysql:platform_python_implementation=="CPython"': [ 'MySQL-python>=1.2.2', @@ -100,6 +99,7 @@ setup( 'oracle': [ 'cx_Oracle>=4.3.1' ], + 'test': tests_require, }, entry_points = { 'console_scripts': [