Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add Travis CI config file #32

Merged
merged 1 commit into from

2 participants

Trey Hunner Carl Meyer
Trey Hunner
Collaborator

I've already confirmed that this file works on Travis CI by running it on my local repository: https://travis-ci.org/treyhunner/django-model-utils/builds/5559574

I also tried adding Python 3.3 tests with Django 1.5 in a separate branch but it is currently failing with Python 3 (as seen here). I also wasn't sure what the lowest supported Django version should be, but the tests seem to pass against Django 1.3.7 at least.

It's relatively easy to remove change this file to check against Django's git master branch as well.

This is the first .travis.yml file I've made. It was easier than I expected.

Trey Hunner
Collaborator

Travis CI supports MySQL and Postgres database access. I haven't tried using a real database for Travis tests yet, but it seems like running the tests against sqlite3, mysql, and postgres automatically might be a good idea.

I'm not sure yet what the most appropriate way to do that would be. Using dj-database-url in runtests.py is one option.

Carl Meyer
Owner

Thanks for working on this! So tox.ini is what documents the supported versions of both Python and Django (and allows running tests locally against all these versions, just pip install tox and then run tox). I just noticed though that tox.ini hasn't yet been updated to account for the release of Django 1.5, which I need to do. Otherwise it's correct -- model-utils still supports back to Django 1.2 (though I wouldn't mind dropping 1.2 support pretty soon here.) In any case, I'd like for the Travis file to match tox.ini, including testing against Django trunk, since I will continue to use tox for running tests locally before commit/merge.

And no, model-utils doesn't yet support Python 3 - I'll open a ticket for that, it needs to happen soon.

Trey Hunner
Collaborator

I forgot that there was a tox.ini file to check for versions. The Travis configuration file has been updated to include Django 1.2 and Django trunk along with matching South/no-South tests present in the tox configuration.

Some differences:

  • Python 2.5 is tested by Travis but not by tox
  • code coverage is not evaluated in Travis
  • Django 1.5 isn't (yet) tested by tox
Carl Meyer carljm merged commit 5003268 into from
Carl Meyer
Owner

Thanks, merged!

Trey Hunner
Collaborator

It looks like you need to link Travis to your Github account and enable it for this repository for it to start working.

Currently works: https://travis-ci.org/treyhunner/django-model-utils/

Currently doesn't work: https://travis-ci.org/carljm/django-model-utils/

I think that's why pull request #33 isn't showing a build status.

Carl Meyer
Owner

Ok, I think I set this up. There seemed to be a build in progress for #33, but I was impatient so I just ran the tests locally and pushed it, thanks for that :-) Gonna put out a 1.3 release pretty soon here, unless you know of a reason to wait.

Trey Hunner
Collaborator

Great. I also noticed the build progress for #33.. the Travis builds seem to be taking a really long time today for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. Trey Hunner
This page is out of date. Refresh to see the latest.
Showing with 28 additions and 0 deletions.
  1. +28 −0 .travis.yml
28 .travis.yml
View
@@ -0,0 +1,28 @@
+language: python
+
+python:
+ - "2.5"
+ - "2.6"
+ - "2.7"
+
+env:
+ - DJANGO=Django==1.2.7 SOUTH=1
+ - DJANGO=Django==1.3.7 SOUTH=1
+ - DJANGO=Django==1.4.5 SOUTH=1
+ - DJANGO=Django==1.4.5 SOUTH=1
+ - DJANGO=Django==1.5 SOUTH=1
+ - DJANGO=https://github.com/django/django/tarball/master SOUTH=1
+ - DJANGO=Django==1.4.5 SOUTH=0
+
+install:
+ - pip install $DJANGO --use-mirrors
+ - sh -c "if [ '$SOUTH' = '1' ]; then pip install South==0.7.6; fi"
+
+script: python runtests.py
+
+matrix:
+ exclude:
+ - python: "2.5"
+ env: DJANGO=Django==1.5 SOUTH=1
+ - python: "2.5"
+ env: DJANGO=https://github.com/django/django/tarball/master SOUTH=1
Something went wrong with that request. Please try again.