Run database specific tests in separate Travis builds
parent
235c0ea7ec
commit
eb57a04453
10
.travis.yml
10
.travis.yml
|
|
@ -6,8 +6,9 @@ python:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- BACKEND=hsqldb
|
- BACKEND=hsqldb TESTNAME=test_integration.HsqldbTest
|
||||||
- BACKEND=sqlitejdbc
|
- BACKEND=sqlitejdbc TESTNAME=test_integration.SqliteXerialTest
|
||||||
|
- BACKEND=sqlitepy TESTNAME=test_integration.SqlitePyTest
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
# exclude:
|
# exclude:
|
||||||
|
|
@ -15,7 +16,7 @@ matrix:
|
||||||
# env: BACKEND=sqlitejdbc
|
# env: BACKEND=sqlitejdbc
|
||||||
include:
|
include:
|
||||||
- python: 2.7
|
- 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:
|
before_install:
|
||||||
- ci/before_install.sh
|
- ci/before_install.sh
|
||||||
|
|
@ -24,9 +25,10 @@ before_install:
|
||||||
install:
|
install:
|
||||||
- pip install jip==0.7
|
- pip install jip==0.7
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
|
- pip install -r requirements_test.txt
|
||||||
- jip install org.xerial:sqlite-jdbc:3.7.2
|
- jip install org.xerial:sqlite-jdbc:3.7.2
|
||||||
- jip install org.hsqldb:hsqldb:1.8.0.10
|
- jip install org.hsqldb:hsqldb:1.8.0.10
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- export CLASSPATH=$VIRTUAL_ENV/javalib/*
|
- 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."""
|
"""Run unittests in the `tests` directory."""
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def adjust_sys_path(dir_name='libs'):
|
import unittest2 as unittest
|
||||||
"""
|
|
||||||
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
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-x", "--xml", action="store_true", dest="xml",
|
parser.add_option("-x", "--xml", action="store_true", dest="xml",
|
||||||
help="write test report in xunit file format")
|
help="write test report in xunit file format")
|
||||||
(options, args) = parser.parse_args(sys.argv)
|
(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:
|
if options.xml:
|
||||||
import xmlrunner
|
import xmlrunner
|
||||||
runner = xmlrunner.XMLTestRunner(output='build/test-reports')
|
runner = xmlrunner.XMLTestRunner(output='build/test-reports')
|
||||||
else:
|
else:
|
||||||
runner = unittest2.TextTestRunner(verbosity=2)
|
runner = unittest.TextTestRunner(verbosity=2)
|
||||||
result = runner.run(suite)
|
result = runner.run(suite)
|
||||||
if result.wasSuccessful():
|
if result.wasSuccessful():
|
||||||
return 0
|
return 0
|
||||||
Loading…
Reference in New Issue