.travis.yml 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. sudo: false
  2. language: python
  3. python:
  4. - "3.4"
  5. - "3.5"
  6. - "3.6"
  7. env:
  8. - DB=postgres
  9. - DB=mysql
  10. - DB=sqlite
  11. addons:
  12. postgresql: "9.3"
  13. mysql: "5.5"
  14. install:
  15. - cd tracim && python setup.py develop; cd -
  16. - echo coveralls >> install/requirements.txt; echo
  17. - pip install -r install/requirements.txt; echo
  18. before_script:
  19. - cp ${TRAVIS_BUILD_DIR}/tracim/development.ini.base ${TRAVIS_BUILD_DIR}/tracim/development.ini
  20. - cp ${TRAVIS_BUILD_DIR}/tracim/wsgidav.conf.sample ${TRAVIS_BUILD_DIR}/tracim/wsgidav.conf
  21. - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database tracim_test;' -U postgres; fi"
  22. - sh -c "if [ '$DB' = 'postgres' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/\(sqlalchemy.url *= *\).*/\1postgresql:\/\/postgres:dummy@127.0.0.1:5432\/tracim_test?client_encoding=utf8/\" test.ini; fi"
  23. - sh -c "if [ '$DB' = 'postgres' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/\(sqlalchemy.url *= *\).*/\1postgresql:\/\/postgres:dummy@127.0.0.1:5432\/tracim_test?client_encoding=utf8/\" development.ini; fi"
  24. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE tracim_test;'; fi"
  25. - sh -c "if [ '$DB' = 'mysql' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/\(sqlalchemy.url *= *\).*/\mysql+pymysql:\/\/root@localhost\/tracim_test/\" test.ini; fi"
  26. - sh -c "if [ '$DB' = 'mysql' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/<replace_database_uri_here>/mysql+pymysql:\/\/root@localhost\/tracim_test/\" development.ini; fi"
  27. - sh -c "if [ '$DB' = 'sqlite' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/\(sqlalchemy.url *= *\).*/\sqlite:\/\/\/tracim_test.sqlite/\" test.ini; fi"
  28. - sh -c "if [ '$DB' = 'sqlite' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/<replace_database_uri_here>/sqlite:\/\/\/tracim.sqlite/\" development.ini; fi"
  29. - cd ${TRAVIS_BUILD_DIR}/tracim && gearbox setup-app --debug
  30. # command to run tests
  31. script: "cd ${TRAVIS_BUILD_DIR}/tracim && nosetests -c ${TRAVIS_BUILD_DIR}/tracim/test.ini -v --with-coverage --cover-package=tracim --cover-erase"
  32. after_success:
  33. - coveralls