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

Move Agent stubs to ddev (Part 1/2) #6171

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datadog_checks_base/datadog_checks/base/checks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
init_logging()
except ImportError:
from ..stubs import datadog_agent
from ..stubs.log import CheckLoggingAdapter, init_logging
from ..stubs.log import CheckLoggingAdapter, init_logging # type: ignore

init_logging()

Expand Down
3 changes: 3 additions & 0 deletions datadog_checks_base/datadog_checks/stubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# flake8: noqa

# Module moved to datadog_checks_dev, this import is for backward compatibility

from ..base.stubs import *
3 changes: 3 additions & 0 deletions datadog_checks_base/datadog_checks/stubs/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# flake8: noqa

# Module moved to datadog_checks_dev, this import is for backward compatibility

from ..base.stubs._util import *
3 changes: 3 additions & 0 deletions datadog_checks_base/datadog_checks/stubs/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# flake8: noqa

# Module moved to datadog_checks_dev, this import is for backward compatibility

from ..base.stubs.aggregator import *
3 changes: 3 additions & 0 deletions datadog_checks_base/datadog_checks/stubs/datadog_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# flake8: noqa

# Module moved to datadog_checks_dev, this import is for backward compatibility

from ..base.stubs.datadog_agent import *
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

from datadog_checks.base.stubs.common import HistogramBucketStub, MetricStub, ServiceCheckStub
from datadog_checks.base.stubs.similar import build_similar_elements_msg

from ..utils.common import ensure_unicode, to_native_string
from datadog_checks.base.utils.common import ensure_unicode, to_native_string
Comment on lines 10 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from .stubs ... no need to import from base no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually agreed with @ofek, looks like there are lots of opportunities for updating imports from base to dev in the moved files.



def normalize_tags(tags, sort=False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import logging

from ..log import CheckLoggingAdapter as AgentLoggingAdapter
from datadog_checks.base.log import CheckLoggingAdapter as AgentLoggingAdapter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should refactor to never need to import from base


TRACE_LEVEL = 7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import difflib

from datadog_checks.base import AgentCheck
from datadog_checks.base.stubs import similar
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.base.stubs.common import HistogramBucketStub, MetricStub, ServiceCheckStub
from datadog_checks.dev.stubs import similar
from datadog_checks.dev.stubs.aggregator import AggregatorStub
from datadog_checks.dev.stubs.common import HistogramBucketStub, MetricStub, ServiceCheckStub


class TestSimilarAssertionMessages(object):
Expand Down