Skip to content

Commit

Permalink
Code style and check style improve
Browse files Browse the repository at this point in the history
  • Loading branch information
XinRanZhAWS committed Apr 16, 2024
1 parent e71a689 commit eea3ebd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 1 addition & 2 deletions contract-tests/tests/test/amazon/misc/configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def _assert_metric_configuration(self, metrics: List[ResourceScopeMetric], metri
)

def test_xray_id_format(self):
global seen
seen = []
seen: List[str] = []
for _ in range(20):
address: str = self.application.get_container_host_ip()
port: str = self.application.get_exposed_port(self.get_application_port())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing_extensions import override

from amazon.base.contract_test_base import ContractTestBase
from amazon.utils.app_signals_constants import ERROR_METRIC, FAULT_METRIC, LATENCY_METRIC
from amazon.utils.application_signals_constants import ERROR_METRIC, FAULT_METRIC, LATENCY_METRIC
from opentelemetry.proto.common.v1.common_pb2 import AnyValue
from opentelemetry.proto.metrics.v1.metrics_pb2 import Metric
from opentelemetry.proto.trace.v1.trace_pb2 import Span
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List

from resource_attributes_test_base import ResourceAttributesTest, _get_k8s_attributes
from typing_extensions import override

Expand All @@ -8,11 +10,11 @@ class ServiceNameInResourceAttributesTest(ResourceAttributesTest):

@override
# pylint: disable=no-self-use
def get_application_otel_resource_attributes(self):
pairlist = []
def get_application_otel_resource_attributes(self) -> str:
pairlist: List[str] = []
for key, value in _get_k8s_attributes().items():
pairlist.append(key + "=" + value)
return ",".join(pairlist)

def test_service(self):
def test_service(self) -> None:
self.do_misc_test_request("unknown_service")
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List

from resource_attributes_test_base import ResourceAttributesTest, _get_k8s_attributes
from typing_extensions import override
Expand All @@ -9,12 +10,12 @@ class ServiceNameInResourceAttributesTest(ResourceAttributesTest):

@override
# pylint: disable=no-self-use
def get_application_otel_resource_attributes(self):
pairlist = []
def get_application_otel_resource_attributes(self) -> str:
pairlist: List[str] = []
for key, value in _get_k8s_attributes().items():
pairlist.append(key + "=" + value)
pairlist.append("service.name=service-name")
return ",".join(pairlist)

def test_service(self):
def test_service(self) -> None:
self.do_misc_test_request("service-name")
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List

from resource_attributes_test_base import ResourceAttributesTest, _get_k8s_attributes
from typing_extensions import override

Expand All @@ -13,11 +15,11 @@ def get_application_extra_environment_variables(self) -> str:

@override
# pylint: disable=no-self-use
def get_application_otel_resource_attributes(self):
pairlist = []
def get_application_otel_resource_attributes(self) -> str:
pairlist: List[str] = []
for key, value in _get_k8s_attributes().items():
pairlist.append(key + "=" + value)
return ",".join(pairlist)

def test_service(self):
def test_service(self) -> None:
self.do_misc_test_request("service-name-test")

0 comments on commit eea3ebd

Please sign in to comment.