Add GCP test and coverage targets#804
Merged
toumorokoshi merged 11 commits intoopen-telemetry:masterfrom Jun 11, 2020
Merged
Conversation
sjbrunst
approved these changes
Jun 10, 2020
c24t
reviewed
Jun 10, 2020
Member
c24t
left a comment
There was a problem hiding this comment.
I'm seeing test failures still:
% pytest ext/opentelemetry-exporter-cloud-monitoring/tests/test_cloud_monitoring.py -k test_get_metric_descriptor
ext/opentelemetry-exporter-cloud-monitoring/tests/test_cloud_monitoring.py::TestCloudMonitoringMetricsExporter::test_get_metric_descriptor FAILED [100%]
========================================================================== FAILURES ===========================================================================
________________________________________________ TestCloudMonitoringMetricsExporter.test_get_metric_descriptor ________________________________________________
self = <tests.test_cloud_monitoring.TestCloudMonitoringMetricsExporter testMethod=test_get_metric_descriptor>
def test_get_metric_descriptor(self):
client = mock.Mock()
exporter = CloudMonitoringMetricsExporter(client=client)
exporter.project_name = self.project_name
self.assertIsNone(
> exporter._get_metric_descriptor(
MetricRecord(MockMetric(), (), UnsupportedAggregator())
)
)
ext/opentelemetry-exporter-cloud-monitoring/tests/test_cloud_monitoring.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <opentelemetry.exporter.cloud_monitoring.CloudMonitoringMetricsExporter object at 0x10b042310>
record = <opentelemetry.sdk.metrics.export.MetricRecord object at 0x109723d90>
def _get_metric_descriptor(
self, record: MetricRecord
) -> Optional[MetricDescriptor]:
""" We can map Metric to MetricDescriptor using Metric.name or
MetricDescriptor.type. We create the MetricDescriptor if it doesn't
exist already and cache it. Note that recreating MetricDescriptors is
a no-op if it already exists.
:param record:
:return:
"""
> instrument = record.instrument
E AttributeError: 'MetricRecord' object has no attribute 'instrument'
ext/opentelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/cloud_monitoring/__init__.py:70: AttributeError
Also a warning about using app default credentials, looks like some calls to GCP aren't getting mocked?
...ntelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/cloud_monitoring/__init__.py
Show resolved
Hide resolved
d55f780 to
43c797e
Compare
Contributor
Author
The calls to GCP were getting mocked, but theres another thing we do |
Member
|
@c24t want to give a quick final pass and we'll merge? |
srikanthccv
pushed a commit
to srikanthccv/opentelemetry-python
that referenced
this pull request
Nov 1, 2020
* chore: remove binary format Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I forgot to add the tests for Cloud Monitoring exporter into tox.ini :/