Я проверил свое программное обеспечение, которое является приложением Django, локально используя нос. Запуск python manage.py test
работает как положено, но загрузка моего приложения на travis не удалась.
Запуск на моем локальном компьютере:
export CM_DATABASE_NAME='cm_db.sqlite3' CM_DATABASE_USERS_NAME='messenger_users_db.sqlite3' CM_DATABASE_ENGINE='django.db.backends.sqlite3' CM_DATABASE_USER='' CM_DATABASE_PASSWORD='' \
CM_DATABASE_HOST='' CM_DATABASE_PORT='' CM_DATABASE_USERS_ENGINE='django.db.backends.sqlite3'
(venv) tian@Kaji-Ryoji:~/utz/afi/afinidata-content-manager> python manage.py test
engine: django.db.backends.sqlite3
db name: cm_db.sqlite3
nosetests --verbosity=3 --with-coverage --cover-tests --cover-package=content_manager,messenger_users,posts
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
nose.plugins.cover: INFO: Coverage report will include only packages: ['content_manager', 'messenger_users', 'posts']
Creating test database for alias 'default'...
Creating test database for alias 'messenger_users_db'...
nose.selector: INFO: /home/tian/utz/afi/afinidata-content-manager/manage.py is executable; skipped
test_creation_posts (posts.tests.PostsTest) ... ok
test_update_post (posts.tests.PostsTest) ... ok
Name Stmts Miss Cover
----------------------------------------------------------
content_manager/__init__.py 0 0 100%
content_manager/settings/__init__.py 1 1 0%
content_manager/settings/base.py 37 37 0%
messenger_users/__init__.py 0 0 100%
messenger_users/admin.py 1 1 0%
messenger_users/apps.py 3 3 0%
messenger_users/models.py 119 119 0%
messenger_users/routers.py 17 3 82%
messenger_users/tests.py 1 0 100%
posts/__init__.py 0 0 100%
posts/admin.py 6 6 0%
posts/apps.py 3 3 0%
posts/models.py 126 126 0%
posts/tests.py 21 0 100%
----------------------------------------------------------
TOTAL 335 299 11%
----------------------------------------------------------------------
Ran 2 tests in 0.197s
OK
Destroying test database for alias 'default'...
Destroying test database for alias 'messenger_users_db'...
Мой файл travis:
dist: xenial # required for Python >= 3.7
language: python
python:
- "3.7"
env:
- CM_DATABASE_NAME='cm_db.sqlite3' CM_DATABASE_USERS_NAME='messenger_users_db.sqlite3' CM_DATABASE_ENGINE='django.db.backends.sqlite3' CM_DATABASE_USER='' CM_DATABASE_PASSWORD='' \
CM_DATABASE_HOST='' CM_DATABASE_PORT='' CM_DATABASE_USERS_ENGINE='django.db.backends.sqlite3'
install:
- pip install -r requirements.txt
- pip install .
# command to run tests
script:
- python manage.py makemigrations && python manage.py migrate auth && python manage.py migrate --database=default && python manage.py migrate --database=messenger_users_db && python manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'adminpass')" && python manage.py test --keepdb
# /6025992/kak-avtomatizirovat-sozdanie-polzovatelei-na-django
# Push the results back to codecov
after_success:
- codecov
В частности, ветка tester .
https://travis -ci.com / afinidata2019 / afinidata-content-manager