.travis.yml 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. - cat install/requirements.postgresql.txt >> install/requirements.txt; echo
  18. - cat install/requirements.mysql.txt >> install/requirements.txt; echo
  19. - pip install -r install/requirements.txt; echo
  20. - cd tracim && python setup.py compile_catalog && cd -
  21. before_script:
  22. - cp ${TRAVIS_BUILD_DIR}/tracim/development.ini.base ${TRAVIS_BUILD_DIR}/tracim/development.ini
  23. - cp ${TRAVIS_BUILD_DIR}/tracim/wsgidav.conf.sample ${TRAVIS_BUILD_DIR}/tracim/wsgidav.conf
  24. - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database tracim_test;' -U postgres; fi"
  25. - 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"
  26. - 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"
  27. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE tracim_test;'; fi"
  28. - 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"
  29. - 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"
  30. - sh -c "if [ '$DB' = 'sqlite' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/\(sqlalchemy.url *= *\).*/\sqlite:\/\/\/tracim_test.sqlite/\" test.ini; fi"
  31. - sh -c "if [ '$DB' = 'sqlite' ]; then cd ${TRAVIS_BUILD_DIR}/tracim && sed -i \"s/<replace_database_uri_here>/sqlite:\/\/\/tracim.sqlite/\" development.ini; fi"
  32. - cd ${TRAVIS_BUILD_DIR}/tracim && gearbox setup-app --debug
  33. # command to run tests
  34. script: "cd ${TRAVIS_BUILD_DIR}/tracim && nosetests -c ${TRAVIS_BUILD_DIR}/tracim/test.ini -v --with-coverage --cover-package=tracim --cover-erase"
  35. after_success:
  36. - coveralls