Argh, Travis

This commit is contained in:
Markus Unterwaditzer 2014-03-19 16:23:56 +01:00
parent bce581df37
commit f7690ad96a
6 changed files with 33 additions and 25 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ htmlcov
build build
env env
owncloud-testserver owncloud-testserver
*.egg-info

View file

@ -1,11 +1,14 @@
language: python language: python
python: "2.7" python: "2.7"
env: env:
- DAV_SERVER=radicale RADICALE_STORAGE=filesystem global:
- DAV_SERVER=radicale RADICALE_STORAGE=database - IS_TRAVIS=true
- DAV_SERVER=radicale_git RADICALE_STORAGE=filesystem matrix:
- DAV_SERVER=radicale_git RADICALE_STORAGE=database - DAV_SERVER=radicale_filesystem REQUIREMENTS=release
- DAV_SERVER=owncloud - DAV_SERVER=radicale_filesystem REQUIREMENTS=devel
- DAV_SERVER=radicale_database REQUIREMENTS=release
- DAV_SERVER=radicale_database REQUIREMENTS=devel
- DAV_SERVER=owncloud REQUIREMENTS=release
install: "./install-deps.sh" install: "./install-deps.sh"
script: "./run-tests.sh tests/" script: "./run-tests.sh tests/"

View file

@ -1,28 +1,30 @@
#!/bin/sh #!/bin/sh
pip install --use-mirrors . echo "The shell is $SHELL"
set -e
pip install --use-mirrors --editable .
pip install --use-mirrors -r requirements.txt pip install --use-mirrors -r requirements.txt
[[ -z "$DAV_SERVER" ]] && DAV_SERVER=radicale [ -n "$DAV_SERVER" ] || DAV_SERVER=radicale_filesystem
[[ -z "$RADICALE_STORAGE" ]] && RADICALE_STORAGE=filesystem
davserver_radicale() { davserver_radicale_filesystem() {
pip install --use-mirrors radicale
radicale_deps radicale_deps
} }
davserver_radicale_git() { davserver_radicale_database() {
pip install git+https://github.com/Kozea/Radicale.git
radicale_deps radicale_deps
pip install --use-mirrors sqlalchemy pysqlite
} }
radicale_deps() { radicale_deps() {
pip install --use-mirrors werkzeug if [ "$REQUIREMENTS" == "release" ]; then
radicale_storage_$RADICALE_STORAGE radicale_pkg="radicale"
elif [ "$REQUIREMENTS" == "devel" ]; then
radicale_pkg="git+https://github.com/Kozea/Radicale.git"
else
false
fi
pip install --use-mirrors werkzeug $radicale_pkg
} }
radicale_storage_database() { pip install --use-mirrors sqlalchemy pysqlite; }
radicale_storage_filesystem() { true; }
davserver_owncloud() { davserver_owncloud() {
git clone https://github.com/untitaker/owncloud-testserver.git git clone https://github.com/untitaker/owncloud-testserver.git
cd ./owncloud-testserver/ cd ./owncloud-testserver/

10
run-tests.sh Normal file → Executable file
View file

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
[[ -z "$DAV_SERVER" ]] && DAV_SERVER=radicale set -e
[[ -z "$RADICALE_STORAGE" ]] && RADICALE_STORAGE=filesystem [ -n "$DAV_SERVER" ] || DAV_SERVER=radicale_filesystem
davserver_radicale() { true; } davserver_radicale_database() { true; }
davserver_radicale_git() { true; } davserver_radicale_filesystem() { true; }
davserver_owncloud() { davserver_owncloud() {
sh ./owncloud-testserver/php.sh sh ./owncloud-testserver/php.sh > /dev/null
} }

View file

@ -17,7 +17,7 @@ import requests.exceptions
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale' dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
if dav_server in ('radicale', 'radicale_git'): if dav_server.startswith('radicale_'):
from ._radicale import ServerMixin from ._radicale import ServerMixin
elif dav_server == 'owncloud': elif dav_server == 'owncloud':
from ._owncloud import ServerMixin from ._owncloud import ServerMixin

View file

@ -57,6 +57,8 @@ create table property (
primary key (name, collection_path)); primary key (name, collection_path));
''' '''
dav_server = os.environ.get('DAV_SERVER', 'radicale_filesystem')
def do_the_radicale_dance(tmpdir): def do_the_radicale_dance(tmpdir):
# All of radicale is already global state, the cleanliness of the code and # All of radicale is already global state, the cleanliness of the code and
@ -75,7 +77,7 @@ def do_the_radicale_dance(tmpdir):
# Now we can set some basic configuration. # Now we can set some basic configuration.
radicale.config.set('rights', 'type', 'None') radicale.config.set('rights', 'type', 'None')
if os.environ.get('RADICALE_STORAGE', 'filesystem') == 'filesystem': if dav_server == 'radicale_filesystem':
radicale.config.set('storage', 'type', 'filesystem') radicale.config.set('storage', 'type', 'filesystem')
radicale.config.set('storage', 'filesystem_folder', tmpdir) radicale.config.set('storage', 'filesystem_folder', tmpdir)
else: else: