Run database specific tests in separate Travis builds
parent
235c0ea7ec
commit
eb57a04453
10
.travis.yml
10
.travis.yml
|
|
@ -6,8 +6,9 @@ python:
|
|||
|
||||
env:
|
||||
matrix:
|
||||
- BACKEND=hsqldb
|
||||
- BACKEND=sqlitejdbc
|
||||
- BACKEND=hsqldb TESTNAME=test_integration.HsqldbTest
|
||||
- BACKEND=sqlitejdbc TESTNAME=test_integration.SqliteXerialTest
|
||||
- BACKEND=sqlitepy TESTNAME=test_integration.SqlitePyTest
|
||||
|
||||
matrix:
|
||||
# exclude:
|
||||
|
|
@ -15,7 +16,7 @@ matrix:
|
|||
# env: BACKEND=sqlitejdbc
|
||||
include:
|
||||
- python: 2.7
|
||||
env: JYTHON=org.python:jython-installer:2.5.3 BACKEND=hsqldb
|
||||
env: JYTHON=org.python:jython-installer:2.5.3 BACKEND=hsqldb TESTNAME=test_integration.HsqldbTest
|
||||
|
||||
before_install:
|
||||
- ci/before_install.sh
|
||||
|
|
@ -24,9 +25,10 @@ before_install:
|
|||
install:
|
||||
- pip install jip==0.7
|
||||
- pip install -e .
|
||||
- pip install -r requirements_test.txt
|
||||
- jip install org.xerial:sqlite-jdbc:3.7.2
|
||||
- jip install org.hsqldb:hsqldb:1.8.0.10
|
||||
|
||||
script:
|
||||
- export CLASSPATH=$VIRTUAL_ENV/javalib/*
|
||||
- python test.py
|
||||
- python test/testsuite.py $TESTNAME
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
unittest2==0.5.1
|
||||
xmlrunner==1.7.4
|
||||
|
|
@ -2,33 +2,26 @@
|
|||
"""Run unittests in the `tests` directory."""
|
||||
|
||||
from optparse import OptionParser
|
||||
import os
|
||||
import sys
|
||||
|
||||
def adjust_sys_path(dir_name='libs'):
|
||||
"""
|
||||
Patch to search the libs folder. At the moment, I believe it's unable to
|
||||
find .egg's, but it does search libs for imports before anything else.
|
||||
"""
|
||||
root_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, os.path.join(root_dir, dir_name))
|
||||
|
||||
adjust_sys_path('libs')
|
||||
adjust_sys_path('src')
|
||||
|
||||
import unittest2
|
||||
import unittest2 as unittest
|
||||
|
||||
def main():
|
||||
parser = OptionParser()
|
||||
parser.add_option("-x", "--xml", action="store_true", dest="xml",
|
||||
help="write test report in xunit file format")
|
||||
(options, args) = parser.parse_args(sys.argv)
|
||||
suite = unittest2.loader.TestLoader().discover('src/test')
|
||||
loader = unittest.defaultTestLoader
|
||||
names = args[1:]
|
||||
if names:
|
||||
suite = loader.loadTestsFromNames(names)
|
||||
else:
|
||||
suite = loader.discover('test')
|
||||
if options.xml:
|
||||
import xmlrunner
|
||||
runner = xmlrunner.XMLTestRunner(output='build/test-reports')
|
||||
else:
|
||||
runner = unittest2.TextTestRunner(verbosity=2)
|
||||
runner = unittest.TextTestRunner(verbosity=2)
|
||||
result = runner.run(suite)
|
||||
if result.wasSuccessful():
|
||||
return 0
|
||||
Loading…
Reference in New Issue