Skip to content

Commit

Permalink
Use celery test by default.
Browse files Browse the repository at this point in the history
We will use healthcheck for deployment check but not proxy test.
  • Loading branch information
sukrit007 committed Mar 19, 2015
1 parent 4ed2fd5 commit f06cc0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deployer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.1.9'
__version__ = '0.1.10'
__author__ = 'sukrit'

import logging
Expand Down
2 changes: 1 addition & 1 deletion deployer/services/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _check_celery():
return 'Celery ping:%s' % output


def get_health(check_celery=False):
def get_health(check_celery=True):
"""
Gets the health of the all the external services.
Expand Down
2 changes: 1 addition & 1 deletion deployer/views/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get(self, **kwargs):
:return: Flask Json Response containing version.
"""
check_celery = request.args.get('celery', 'false').lower() in \
check_celery = request.args.get('celery', 'true').lower() in \
BOOLEAN_TRUE_VALUES
health = get_health(check_celery)
failed_checks = [
Expand Down
12 changes: 11 additions & 1 deletion tests/unit/services/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_get_health_when_elasticsearch_is_enabled(client, get_es, ping):
"""

# Given: Operational external services"
ping.delay().get.return_value = 'pong'
get_es().info.return_value = 'mock'
EtcdInfo = namedtuple('Info', ('machines', 'leader'))
client.Client.return_value = EtcdInfo(['machine1'], 'machine1')
Expand All @@ -46,6 +47,10 @@ def test_get_health_when_elasticsearch_is_enabled(client, get_es, ping):
'elasticsearch': {
'status': HEALTH_OK,
'details': 'mock'
},
'celery': {
'status': HEALTH_OK,
'details': 'Celery ping:pong'
}
})

Expand All @@ -61,6 +66,7 @@ def test_get_health_when_elasticsearch_is_disabled(client, ping):
"""

# Given: Operational external services"
ping.delay().get.return_value = 'pong'
EtcdInfo = namedtuple('Info', ('machines', 'leader'))
client.Client.return_value = EtcdInfo(['machine1'], 'machine1')

Expand All @@ -75,7 +81,11 @@ def test_get_health_when_elasticsearch_is_disabled(client, ping):
'machines': ['machine1'],
'leader': 'machine1'
}
}
},
'celery': {
'status': HEALTH_OK,
'details': 'Celery ping:pong'
},
})


Expand Down

0 comments on commit f06cc0d

Please sign in to comment.