Skip to content

Commit

Permalink
Add postgresql binary funtional test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuluPro committed Apr 30, 2017
1 parent df1c59b commit 939d067
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
37 changes: 36 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ python:
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "pypy"
- "pypy3"
- "nightly"

services:
- mysql
Expand All @@ -23,6 +26,8 @@ env:
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=1.11
- DJANGO=master

install:
- TOX_ENV=py${TRAVIS_PYTHON_VERSION}-django${DJANGO}
Expand Down Expand Up @@ -59,6 +64,7 @@ matrix:
- DATABASE_URL=sqlite:////tmp/db.sqlite tox -e functional
- DATABASE_URL=mysql://travis:@localhost/test tox -e functional
- DATABASE_URL=postgres://postgres:@localhost/test tox -e functional
- CONNECTOR=dbbackup.db.postgresql.PgDumpBinaryConnector DATABASE_URL=postgres://postgres:@localhost/test tox -e functional
- python: "3.4"
env: TOX_ENV=upgrade
install:
Expand All @@ -74,8 +80,16 @@ matrix:
exclude:
- python: "3.5"
env: DJANGO=1.6
- python: "nightly"
env: DJANGO=1.6
- python: "3.6"
env: DJANGO=1.6
- python: "3.5"
env: DJANGO=1.7
- python: "3.6"
env: DJANGO=1.7
- python: "nightly"
env: DJANGO=1.7
- python: "3.2"
env: DJANGO=1.9
- python: "3.3"
Expand All @@ -94,5 +108,26 @@ matrix:
env: DJANGO=1.10
- python: "pypy3"
env: DJANGO=1.10
- python: "3.2"
env: DJANGO=1.11
- python: "3.3"
env: DJANGO=1.11
- python: "pypy3"
env: DJANGO=1.11
- python: "2.7"
env: DJANGO=master
- python: "3.2"
env: DJANGO=master
- python: "3.3"
env: DJANGO=master
- python: "pypy"
env: DJANGO=master
- python: "pypy3"
env: DJANGO=master
- python: "nightly"
env: DJANGO=master
allow_failures:
- python: pypy3
- python: "pypy3"
- python: "nightly"
- python: "3.7"
- env: DJANGO=master
2 changes: 1 addition & 1 deletion dbbackup/db/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _create_dump(self):
return stdout

def _restore_dump(self, dump):
cmd = '{} {}'.format(self.restore_cmd, self.settings['NAME'])
cmd = '{} --dbname={}'.format(self.restore_cmd, self.settings['NAME'])
if self.settings.get('HOST'):
cmd += ' --host={}'.format(self.settings['HOST'])
if self.settings.get('PORT'):
Expand Down
3 changes: 3 additions & 0 deletions dbbackup/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
DATABASE = dj_database_url.config(default='sqlite:///%s' %
tempfile.mktemp())
DATABASES = {'default': DATABASE}
if os.environ.get('CONNECTOR'):
CONNECTOR = {'CONNECTOR': os.environ['CONNECTOR']}
DBBACKUP_CONNECTORS = {'default': CONNECTOR}

CACHES = {
'default': {
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CharModel(models.Model):


class ForeignKeyModel(models.Model):
field = models.ForeignKey(CharModel)
field = models.ForeignKey(CharModel, on_delete=models.CASCADE)


class ManyToManyModel(models.Model):
Expand Down
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docutils<0.13.1
Sphinx==1.3.1
sphinx-django-command
dj-database-url
8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{2.7,3.2,3.3,3.4,3.5,pypy,pypy3}-django{1.6,1.7,1.8,1.9,1.10},lint,docs,functional
envlist = py{2.7,3.2,3.3,3.4,3.5,3.6,pypy,pypy3}-django{1.6,1.7,1.8,1.9,1.10,1.11,master},lint,docs,functional

[testenv]
passenv = *
Expand All @@ -9,15 +9,19 @@ basepython =
py3.3: python3.3
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
pypypy: pypy
pypypy3: pypy3
pynightly: python
deps =
-rrequirements-tests.txt
django1.6: Django>=1.6,<1.7
django1.7: Django>=1.7,<1.8
django1.8: Django>=1.8,<1.9
django1.9: Django>=1.9,<1.10
djangomaster: Django>=1.9,<1.10
django1.10: Django>=1.10,<1.11
django1.11: Django>=1.11,<1.12
djangomaster: https://github.com/django/django/archive/master.zip
commands = {posargs:coverage run runtests.py}

[testenv:lint]
Expand Down

0 comments on commit 939d067

Please sign in to comment.