Skip to content

Commit c42b3bd

Browse files
committed
fix: disable telemetry for rw splitting integration tests
1 parent 9f75699 commit c42b3bd

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

aws_advanced_python_wrapper/utils/properties.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
import copy
1516
from typing import Any, Dict, Optional
1617
from urllib.parse import unquote

tests/integration/container/test_aurora_failover.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ def props(self):
7474
"autocommit": True
7575
})
7676

77-
features = TestEnvironment.get_current().get_features()
78-
if TestEnvironmentFeatures.TELEMETRY_TRACES_ENABLED in features \
79-
or TestEnvironmentFeatures.TELEMETRY_METRICS_ENABLED in features:
80-
WrapperProperties.ENABLE_TELEMETRY.set(p, False)
81-
WrapperProperties.TELEMETRY_SUBMIT_TOPLEVEL.set(p, False)
82-
if TestEnvironmentFeatures.TELEMETRY_TRACES_ENABLED in features:
83-
WrapperProperties.TELEMETRY_TRACES_BACKEND.set(p, "XRAY")
84-
if TestEnvironmentFeatures.TELEMETRY_METRICS_ENABLED in features:
85-
WrapperProperties.TELEMETRY_METRICS_BACKEND.set(p, "OTLP")
86-
8777
return p
8878

8979
@pytest.fixture(scope='class')

tests/integration/container/test_read_write_splitting.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from aws_advanced_python_wrapper.host_list_provider import RdsHostListProvider
2727
from aws_advanced_python_wrapper.sql_alchemy_connection_provider import \
2828
SqlAlchemyPooledConnectionProvider
29+
from aws_advanced_python_wrapper.utils.log import Logger
2930
from aws_advanced_python_wrapper.utils.properties import (Properties,
3031
WrapperProperties)
3132
from tests.integration.container.utils.conditions import (
@@ -51,6 +52,15 @@
5152
TestEnvironmentFeatures.BLUE_GREEN_DEPLOYMENT,
5253
TestEnvironmentFeatures.PERFORMANCE])
5354
class TestReadWriteSplitting:
55+
56+
logger = Logger(__name__)
57+
58+
@pytest.fixture(autouse=True)
59+
def setup_method(self, request):
60+
self.logger.info(f"Starting test: {request.node.name}")
61+
yield
62+
self.logger.info(f"Ending test: {request.node.name}")
63+
5464
@pytest.fixture(scope='class')
5565
def rds_utils(self):
5666
region: str = TestEnvironment.get_current().get_info().get_region()
@@ -64,20 +74,7 @@ def clear_caches(self):
6474

6575
@pytest.fixture(scope='class')
6676
def props(self):
67-
p: Properties = Properties({"plugins": "read_write_splitting", "connect_timeout": 30, "autocommit": True})
68-
69-
if TestEnvironmentFeatures.TELEMETRY_TRACES_ENABLED in TestEnvironment.get_current().get_features() \
70-
or TestEnvironmentFeatures.TELEMETRY_METRICS_ENABLED in TestEnvironment.get_current().get_features():
71-
WrapperProperties.ENABLE_TELEMETRY.set(p, "True")
72-
WrapperProperties.TELEMETRY_SUBMIT_TOPLEVEL.set(p, "True")
73-
74-
if TestEnvironmentFeatures.TELEMETRY_TRACES_ENABLED in TestEnvironment.get_current().get_features():
75-
WrapperProperties.TELEMETRY_TRACES_BACKEND.set(p, "XRAY")
76-
77-
if TestEnvironmentFeatures.TELEMETRY_METRICS_ENABLED in TestEnvironment.get_current().get_features():
78-
WrapperProperties.TELEMETRY_METRICS_BACKEND.set(p, "OTLP")
79-
80-
return p
77+
return Properties({"plugins": "read_write_splitting", "socket_timeout": 10, "connect_timeout": 10, "autocommit": True})
8178

8279
@pytest.fixture(scope='class')
8380
def failover_props(self):

0 commit comments

Comments
 (0)