Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run integration tests together with e2e ones #17986

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Move rabbitmq tests to correct category
  • Loading branch information
vivek-datadog committed Jul 19, 2024
commit 2fdfa30c19e81fa33cbfadf659baecbadf5a87ca
27 changes: 27 additions & 0 deletions rabbitmq/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from datadog_checks.rabbitmq import RabbitMQ

from . import common, metrics
from .common import (
CONFIG,
CONFIG_DEFAULT_VHOSTS,
Expand Down Expand Up @@ -219,3 +220,29 @@ def test_connections(aggregator, check):
aggregator.assert_metric('rabbitmq.connections', tags=['rabbitmq_vhost:test2'], value=0, count=1)
aggregator.assert_metric('rabbitmq.connections', count=2)
aggregator.assert_metric('rabbitmq.connections.state', tags=['rabbitmq_conn_state:running'], value=0, count=0)


def test_nodes(aggregator, check):

# default, node metrics are collected
check = RabbitMQ('rabbitmq', {}, instances=[common.CONFIG])
check.check(common.CONFIG)

for m in metrics.COMMON_METRICS:
aggregator.assert_metric(m, count=1)

aggregator.reset()


def test_disable_nodes(aggregator, check):

# node metrics collection disabled in config, node metrics should not appear
check = RabbitMQ('rabbitmq', {}, instances=[common.CONFIG_NO_NODES])
check.check(common.CONFIG_NO_NODES)

for m in metrics.COMMON_METRICS:
aggregator.assert_metric(m, count=0)

# check to ensure other metrics are being collected
for m in metrics.Q_METRICS:
aggregator.assert_metric(m, count=1)
26 changes: 0 additions & 26 deletions rabbitmq/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,32 +157,6 @@ def test_config(check, test_case, extra_config, expected_http_kwargs):
r.get.assert_called_with('http://localhost:15672/api/connections', **http_wargs)


def test_nodes(aggregator, check):

# default, node metrics are collected
check = RabbitMQ('rabbitmq', {}, instances=[common.CONFIG])
check.check(common.CONFIG)

for m in metrics.COMMON_METRICS:
aggregator.assert_metric(m, count=1)

aggregator.reset()


def test_disable_nodes(aggregator, check):

# node metrics collection disabled in config, node metrics should not appear
check = RabbitMQ('rabbitmq', {}, instances=[common.CONFIG_NO_NODES])
check.check(common.CONFIG_NO_NODES)

for m in metrics.COMMON_METRICS:
aggregator.assert_metric(m, count=0)

# check to ensure other metrics are being collected
for m in metrics.Q_METRICS:
aggregator.assert_metric(m, count=1)


def test_queues_regexes_exclude_with_negative_lookahead(aggregator, dd_run_check):
"""Based on a support case where a customer was confused why their regular expression didn't work.

Expand Down
Loading