Updated tests configuration, avoid circular imports with new dal
This commit is contained in:
+4
-43
@@ -4,59 +4,20 @@ python:
|
|||||||
- '2.6'
|
- '2.6'
|
||||||
- '2.7'
|
- '2.7'
|
||||||
- 'pypy'
|
- 'pypy'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
env:
|
|
||||||
- DB=sqlite:memory
|
|
||||||
- DB=mysql://root:@localhost/test_w2p
|
|
||||||
- DB=postgres://postgres:@localhost/test_w2p
|
|
||||||
- DB=google:datastore
|
|
||||||
# - DB=google:datastore+ndb
|
|
||||||
- DB=mongodb://mongodb:mongodb@localhost/test_w2p
|
|
||||||
- DB=imap://imap:imap@localhost:993
|
|
||||||
before_script:
|
before_script:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then pip install unittest2; fi
|
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install coverage; fi;
|
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install python-coveralls; fi
|
|
||||||
- if [[ $DB == postgres* ]]; then pip install psycopg2; fi;
|
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install pysqlite; fi
|
|
||||||
- if [[ $DB == mysql* ]]; then mysql -e 'create database test_w2p;'; fi
|
|
||||||
- if [[ $DB == postgres* ]]; then psql -c 'create database test_w2p;' -U postgres; fi
|
|
||||||
- if [[ $DB == postgres* ]]; then psql -c 'create extension postgis;' -U postgres -d test_w2p; fi
|
|
||||||
|
|
||||||
|
|
||||||
# Install last sdk for app engine (update only whenever a new release is available)
|
|
||||||
- if [[ $DB == google* ]]; then wget http://googleappengine.googlecode.com/files/google_appengine_1.8.9.zip -nv; fi
|
|
||||||
- if [[ $DB == google* ]]; then unzip -q google_appengine_1.8.9.zip; fi
|
|
||||||
- if [[ $DB == google* ]]; then mv -f ./google_appengine/google ./google; fi
|
|
||||||
|
|
||||||
- if [[ $DB == mongodb* ]]; then pip install pymongo; fi
|
|
||||||
- if [[ $DB == mongodb* ]]; then mongo test_w2p --eval 'db.addUser("mongodb", "mongodb");'; fi
|
|
||||||
|
|
||||||
#Temporal solution to travis issue #155
|
#Temporal solution to travis issue #155
|
||||||
- sudo chmod 777 /dev/shm
|
- sudo chmod 777 /dev/shm
|
||||||
- sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
|
- sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
|
||||||
matrix:
|
|
||||||
exclude:
|
|
||||||
- python: 'pypy'
|
|
||||||
env: DB=postgres://postgres:@localhost/test_w2p
|
|
||||||
- python: 'pypy'
|
|
||||||
env: DB=mysql://root:@localhost/test_w2p
|
|
||||||
- python: 'pypy'
|
|
||||||
env: DB=google:datastore
|
|
||||||
- python: '2.6'
|
|
||||||
env: DB=google:datastore
|
|
||||||
# - python: '2.6'
|
|
||||||
# env: DB=google:datastore+ndb
|
|
||||||
|
|
||||||
|
|
||||||
script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage
|
script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage combine; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage combine; fi
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/coverage.ini; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/coverage.ini; fi
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: true
|
email: true
|
||||||
|
|
||||||
services: mongodb
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,6 @@ from gluon.serializers import json, custom_json
|
|||||||
import gluon.settings as settings
|
import gluon.settings as settings
|
||||||
from gluon.utils import web2py_uuid, secure_dumps, secure_loads
|
from gluon.utils import web2py_uuid, secure_dumps, secure_loads
|
||||||
from gluon.settings import global_settings
|
from gluon.settings import global_settings
|
||||||
from gluon.dal import Field
|
|
||||||
from gluon import recfile
|
from gluon import recfile
|
||||||
import hashlib
|
import hashlib
|
||||||
import portalocker
|
import portalocker
|
||||||
@@ -767,6 +766,7 @@ class Session(Storage):
|
|||||||
compression_level(int): 0-9, sets zlib compression on the data
|
compression_level(int): 0-9, sets zlib compression on the data
|
||||||
before the encryption
|
before the encryption
|
||||||
"""
|
"""
|
||||||
|
from gluon.dal import Field
|
||||||
request = request or current.request
|
request = request or current.request
|
||||||
response = response or current.response
|
response = response or current.response
|
||||||
masterapp = masterapp or request.application
|
masterapp = masterapp or request.application
|
||||||
|
|||||||
+2
-11
@@ -1,4 +1,4 @@
|
|||||||
import os, sys
|
import sys
|
||||||
|
|
||||||
from test_http import *
|
from test_http import *
|
||||||
from test_cache import *
|
from test_cache import *
|
||||||
@@ -16,16 +16,7 @@ from test_validators import *
|
|||||||
from test_utils import *
|
from test_utils import *
|
||||||
from test_contribs import *
|
from test_contribs import *
|
||||||
from test_web import *
|
from test_web import *
|
||||||
|
from test_dal import *
|
||||||
|
|
||||||
if sys.version[:3] == '2.7':
|
if sys.version[:3] == '2.7':
|
||||||
from test_old_doctests import *
|
from test_old_doctests import *
|
||||||
|
|
||||||
|
|
||||||
NOSQL = any([name in (os.getenv("DB") or "")
|
|
||||||
for name in ("datastore", "mongodb", "imap")])
|
|
||||||
|
|
||||||
if NOSQL:
|
|
||||||
from test_dal_nosql import *
|
|
||||||
else:
|
|
||||||
from test_dal import *
|
|
||||||
Reference in New Issue
Block a user