samedi 3 octobre 2015

Travis-CI Error when run test coverage Django Project

This is my first time I use Travis-CI to check my project. I am new in Django. This Django project is not mine, I just fork from another project. I want to put .travis.yml to check the coveralls of the project.

But I got errors that I have no Idea about that. I've looking the answers in Google but I could not found it.

This is the error.

    $ coverage run manage.py test
nosetests --with-coverage --cover-erase --cover-html --cover-html-dir=xmlrunner/html --cover-inclusive --nocapture --nologcapture --verbosity=1
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.9/bin/coverage", line 9, in <module>
    load_entry_point('coverage==4.0', 'console_scripts', 'coverage')()
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coverage/cmdline.py", line 694, in main
    status = CoverageScript().command_line(argv)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coverage/cmdline.py", line 435, in command_line
    return self.do_run(options, args)
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coverage/cmdline.py", line 577, in do_run
    self.coverage.stop()
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coverage/control.py", line 685, in stop
    self.collector.stop()
  File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/coverage/collector.py", line 273, in stop
    "Expected current collector to be %r, but it's %r" % (self, self._collectors[-1])
AssertionError: Expected current collector to be <Collector at 0x7fc81bcd2350: CTracer>, but it's <Collector at 0x7fc809892710: CTracer>

This is my .travis.yml

language: python

services:
  - postgresql

env:
  global:
    - DATABASE_URL='postgres://postgres:@localhost:5432/test_db'
    - SECRET_KEY='tT\xd7\xb06\xf7\x9b\xff\x0fZL\xca\xca\x11\xefM\xacr\xfb\xdf\xca\x9b'
    - DJANGO_SETTINGS_MODULE=core.settings.test_travis

python:
  - '2.7'

addons:
  postgresql: "9.3"

install:
  - pip install coveralls
  - pip install -r REQUIREMENTS.txt


before_script:
  - psql -c 'create database test_db;' -U postgres
  - psql -c 'CREATE EXTENSION postgis;' -U postgres -d test_db
  - cd django_project

script:
  - flake8
  - coverage run manage.py test

after_success:
  - coveralls

This is the link for my project in Travis-CI http://ift.tt/1FMxPgp and this is the link for my project in Github http://ift.tt/1KXS8nN

Aucun commentaire:

Enregistrer un commentaire