Skip to content

Commit

Permalink
Add test for critical service check and fix namespae
Browse files Browse the repository at this point in the history
  • Loading branch information
hithwen committed Sep 6, 2021
1 parent e39df44 commit f763c33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion snowflake/datadog_checks/snowflake/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SnowflakeCheck(AgentCheck):

__NAMESPACE__ = 'snowflake'

SERVICE_CHECK_CONNECT = 'snowflake.can_connect'
SERVICE_CHECK_CONNECT = 'can_connect'

def __init__(self, *args, **kwargs):
super(SnowflakeCheck, self).__init__(*args, **kwargs)
Expand Down
9 changes: 9 additions & 0 deletions snowflake/tests/test_snowflake.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import copy
from decimal import Decimal
from typing import Any, Callable, Dict

Expand All @@ -13,6 +14,14 @@
from .common import CHECK_NAME, EXPECTED_TAGS


def test_emits_critical_service_check_when_service_is_down(dd_run_check, aggregator, instance):
config = copy.deepcopy(instance)
config['login_timeout'] = 5
check = SnowflakeCheck(CHECK_NAME, {}, [config])
dd_run_check(check)
aggregator.assert_service_check('snowflake.can_connect', SnowflakeCheck.CRITICAL)


def test_storage_metrics(dd_run_check, aggregator, instance):
# type: (Callable[[SnowflakeCheck], None], AggregatorStub, Dict[str, Any]) -> None

Expand Down

0 comments on commit f763c33

Please sign in to comment.