Skip to content
Merged
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
9 changes: 5 additions & 4 deletions src/instana/instrumentation/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# (c) Copyright Instana Inc. 2019


import sys
import wrapt
import logging
import sys
from collections.abc import Mapping
from typing import Any, Tuple, Dict, Callable
from typing import Any, Callable, Dict, Tuple

import wrapt

from instana.log import logger
from instana.util.runtime import get_runtime_env_info
Expand All @@ -26,7 +27,7 @@ def log_with_instana(

# We take into consideration if `stacklevel` is already present in `kwargs`.
# This prevents the error `_log() got multiple values for keyword argument 'stacklevel'`
stacklevel_in = kwargs.pop("stacklevel", 1 if get_runtime_env_info()[0] != "ppc64le" else 2)
stacklevel_in = kwargs.pop("stacklevel", 1 if get_runtime_env_info()[0] not in ["ppc64le", "s390x"] else 2)
stacklevel = stacklevel_in + 1 + (sys.version_info >= (3, 14))

try:
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import pytest
from opentelemetry.trace import SpanKind

from instana.util.runtime import get_runtime_env_info
from instana.singletons import agent, tracer
from instana.util.runtime import get_runtime_env_info


class TestLogging:
Expand Down Expand Up @@ -147,7 +147,7 @@ def test_log_caller_with_stacklevel(
)
self.logger.addHandler(handler)

if get_runtime_env_info()[0] == "ppc64le":
if get_runtime_env_info()[0] in ["ppc64le", "s390x"]:
stacklevel += 1

def log_custom_warning():
Expand Down
2 changes: 1 addition & 1 deletion tests/clients/test_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_error_before_tracing(self) -> None:
invalid_connection_url = "postgresql://user1:pwd1@localhost:9999/mydb1"
with pytest.raises(
OperationalError,
match=r"\(psycopg2.OperationalError\) connection .* failed.*",
match=r"^(\(psycopg2\.OperationalError\)).*",
) as context_manager:
engine = create_engine(invalid_connection_url)
with engine.connect() as connection:
Expand Down
35 changes: 21 additions & 14 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
"*agent/test_google*",
]

# ppc64le has limitations with some supported libraries.
# ppc64le and s390x have limitations with some supported libraries.
machine, py_version = get_runtime_env_info()
if machine == "ppc64le":
collect_ignore_glob.append("*test_grpcio*")
collect_ignore_glob.append("*test_google-cloud*")
collect_ignore_glob.append("*test_pymongo*")
if machine in ["ppc64le", "s390x"]:
collect_ignore_glob.extend([
"*test_google-cloud*",
"*test_pymongo*",
])

if machine == "ppc64le":
collect_ignore_glob.append("*test_grpcio*")

# # Cassandra and gevent tests are run in dedicated jobs on CircleCI and will
# # be run explicitly. (So always exclude them here)
Expand All @@ -47,8 +51,10 @@
collect_ignore_glob.append("*test_couchbase*")

if not os.environ.get("GEVENT_STARLETTE_TEST"):
collect_ignore_glob.append("*test_gevent*")
collect_ignore_glob.append("*test_starlette*")
collect_ignore_glob.extend([
"*test_gevent*",
"*test_starlette*",
])

if not os.environ.get("KAFKA_TEST"):
collect_ignore_glob.append("*kafka/test*")
Expand All @@ -59,13 +65,14 @@


if sys.version_info >= (3, 14):
# Currently not installable dependencies because of 3.14 incompatibilities
collect_ignore_glob.append("*test_fastapi*")
# aiohttp-server tests failing due to deprecated methods used
collect_ignore_glob.append("*test_aiohttp_server*")
# Currently Sanic does not support python >= 3.14
collect_ignore_glob.append("*test_sanic*")

collect_ignore_glob.extend([
# Currently not installable dependencies because of 3.14 incompatibilities
"*test_fastapi*",
# aiohttp-server tests failing due to deprecated methods used
"*test_aiohttp_server*",
# Currently Sanic does not support python >= 3.14
"*test_sanic*",
])

@pytest.fixture(scope="session")
def celery_config():
Expand Down
5 changes: 3 additions & 2 deletions tests/recorder/test_stan_recorder.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
from multiprocessing import Queue
import sys
from multiprocessing import Queue
from unittest import TestCase
from unittest.mock import NonCallableMagicMock, PropertyMock

import pytest

from instana.recorder import StanRecorder
from instana.util.runtime import get_runtime_env_info


@pytest.mark.skipif(
sys.platform == "darwin",
sys.platform == "darwin" or get_runtime_env_info()[0] == "s390x",
reason="Avoiding NotImplementedError when calling multiprocessing.Queue.qsize()",
)
class TestStanRecorderTC(TestCase):
Expand Down
16 changes: 9 additions & 7 deletions tests_aws/conftest.py
Comment thread
pvital marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
# (c) Copyright IBM Corp. 2024

import os
import platform

os.environ["INSTANA_ENDPOINT_URL"] = "https://localhost/notreal"
os.environ["INSTANA_AGENT_KEY"] = "Fake_Key"

# ppc64le is not supported by AWS Serverless Services.
# ppc64le and s390x are not supported by AWS Serverless Services.
collect_ignore_glob = []
if platform.machine() == "ppc64le":
collect_ignore_glob.append("*test_lambda*")
collect_ignore_glob.append("*test_fargate*")
collect_ignore_glob.append("*test_eks*")
if platform.machine() in ["ppc64le", "s390x"]:
collect_ignore_glob.extend([
"*test_lambda*",
"*test_fargate*",
"*test_eks*",
])

Loading