Run collectstatic before coverage, use autoreload on celery worker
This commit is contained in:
parent
19cd1624c1
commit
a3ef26b7ad
|
@ -40,6 +40,7 @@ pylint:
|
|||
stage: test
|
||||
coverage:
|
||||
script:
|
||||
- python manage.py collectstatic --no-input
|
||||
- coverage run manage.py test
|
||||
- coverage report
|
||||
stage: test
|
||||
|
|
|
@ -15,7 +15,7 @@ class Command(BaseCommand):
|
|||
"""Run CherryPy webserver"""
|
||||
|
||||
def handle(self, *args, **options):
|
||||
"""passbook cherrypy server"""
|
||||
"""passbook daphne server"""
|
||||
autoreload.run_with_reloader(self.daphne_server)
|
||||
|
||||
def daphne_server(self):
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
from logging import getLogger
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import autoreload
|
||||
|
||||
from passbook.core.celery import CELERY_APP
|
||||
|
||||
|
@ -14,4 +15,9 @@ class Command(BaseCommand):
|
|||
|
||||
def handle(self, *args, **options):
|
||||
"""celery worker"""
|
||||
autoreload.run_with_reloader(self.celery_worker)
|
||||
|
||||
def celery_worker(self):
|
||||
"""Run celery worker within autoreload"""
|
||||
autoreload.raise_last_exception()
|
||||
CELERY_APP.worker_main(['worker', '--autoscale=10,3', '-E', '-B'])
|
||||
|
|
Reference in New Issue