-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In this commit we are fixing various things: * Update project path to start with amazon, not opentelemetry. * Update isort to consider amazon first party. * Fix imports with project path and isort update. * Update some modules/classes to be internal, based on package private classes in Java implementation. * Add basic unit tests to ensure imports are working as expected and setting up the foundation to implement full unit tests later.
- Loading branch information
Showing
13 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
File renamed without changes.
5 changes: 2 additions & 3 deletions
5
.../distro/aws_metric_attribute_generator.py → ...distro/_aws_metric_attribute_generator.py
This file contains 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
1 change: 0 additions & 1 deletion
1
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py
This file contains 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
1 change: 0 additions & 1 deletion
1
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_distro.py
This file contains 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
This file contains 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
This file contains 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
11 changes: 11 additions & 0 deletions
11
...telemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from unittest import TestCase | ||
|
||
from amazon.opentelemetry.distro._aws_metric_attribute_generator import _AwsMetricAttributeGenerator | ||
|
||
|
||
class TestAwsMetricAttributeGenerator(TestCase): | ||
def test_basic(self): | ||
generator: _AwsMetricAttributeGenerator = _AwsMetricAttributeGenerator() | ||
self.assertEqual(generator.generate_metric_attributes_dict_from_span(None, None), {}) |
6 changes: 2 additions & 4 deletions
6
...elemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from unittest import TestCase | ||
|
||
from opentelemetry.distro.aws_opentelemetry_configurator import AwsOpenTelemetryConfigurator, AwsTracerProvider | ||
from amazon.opentelemetry.distro.aws_opentelemetry_configurator import AwsOpenTelemetryConfigurator, AwsTracerProvider | ||
|
||
|
||
class TestAwsOpenTelemetryConfigurator(TestCase): | ||
# pylint: disable=no-self-use | ||
def test_default_configuration(self): | ||
configurator = AwsOpenTelemetryConfigurator() | ||
configurator.configure() | ||
trace_provider = configurator.get_trace_provider() | ||
assert isinstance(trace_provider, AwsTracerProvider) | ||
self.assertTrue(isinstance(trace_provider, AwsTracerProvider)) |
1 change: 0 additions & 1 deletion
1
aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelemetry_distro.py
This file contains 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
11 changes: 11 additions & 0 deletions
11
...opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_span_metrics_processor.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from unittest import TestCase | ||
|
||
from amazon.opentelemetry.distro.aws_span_metrics_processor import AwsSpanMetricsProcessor | ||
|
||
|
||
class TestAwsSpanMetricsProcessor(TestCase): | ||
def test_basic(self): | ||
processor: AwsSpanMetricsProcessor = AwsSpanMetricsProcessor(None, None, None, None, None) | ||
self.assertTrue(processor.force_flush) |
11 changes: 11 additions & 0 deletions
11
...metry-distro/tests/amazon/opentelemetry/distro/test_aws_span_metrics_processor_builder.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from unittest import TestCase | ||
|
||
from amazon.opentelemetry.distro.aws_span_metrics_processor_builder import AwsSpanMetricsProcessorBuilder | ||
|
||
|
||
class TestAwsSpanMetricsProcessorBuilder(TestCase): | ||
def test_basic(self): | ||
builder: AwsSpanMetricsProcessorBuilder = AwsSpanMetricsProcessorBuilder(None, None) | ||
self.assertIs(builder.set_scope_name("test"), builder) |