Skip to content

Commit

Permalink
Merge branch 'main' into develop-k8s-agent-operator
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Jun 13, 2024
2 parents 18e2974 + 4ddc5b1 commit d969238
Show file tree
Hide file tree
Showing 79 changed files with 674 additions and 485 deletions.
1 change: 1 addition & 0 deletions tests/adapter_asgiref/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
23 changes: 12 additions & 11 deletions tests/adapter_cheroot/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (adapter_cheroot)',
default_settings=_default_settings)
app_name="Python Agent Test (adapter_cheroot)", default_settings=_default_settings
)
7 changes: 5 additions & 2 deletions tests/adapter_daphne/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
29 changes: 17 additions & 12 deletions tests/adapter_gevent/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@

import pytest
import webtest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
'debug.disable_harvest_until_shutdown': False,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
"debug.disable_harvest_until_shutdown": False,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (adapter_gevent)',
default_settings=_default_settings)
app_name="Python Agent Test (adapter_gevent)", default_settings=_default_settings
)


@pytest.fixture(autouse=True, scope='session')
@pytest.fixture(autouse=True, scope="session")
def target_application():
import _application

port = _application.setup_application()
return webtest.TestApp('http://localhost:%d' % port)
return webtest.TestApp("http://localhost:%d" % port)
22 changes: 12 additions & 10 deletions tests/adapter_gunicorn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (gunicorn)',
default_settings=_default_settings)
app_name="Python Agent Test (gunicorn)", default_settings=_default_settings
)
7 changes: 5 additions & 2 deletions tests/adapter_hypercorn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611
event_loop as loop,
)
from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
9 changes: 5 additions & 4 deletions tests/adapter_uvicorn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
1 change: 1 addition & 0 deletions tests/adapter_waitress/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
15 changes: 9 additions & 6 deletions tests/agent_features/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
newrelic_caplog as caplog,
)

from newrelic.packages import six


_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
"debug.log_autorum_middleware": True,
"agent_limits.errors_per_harvest": 100,
"ml_insights_events.enabled": True
"ml_insights_events.enabled": True,
}

collector_agent_registration = collector_agent_registration_fixture(
Expand All @@ -52,4 +53,6 @@
"test_ml_events.py",
]
else:
from testing_support.fixture.event_loop import event_loop
from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611
event_loop,
)
7 changes: 5 additions & 2 deletions tests/agent_streaming/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import threading

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)
from testing_support.mock_external_grpc_server import MockExternalgRPCServer

from newrelic.common.streaming_utils import StreamBuffer
Expand All @@ -25,6 +27,7 @@


_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
6 changes: 4 additions & 2 deletions tests/agent_unittests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
import tempfile

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
newrelic_caplog as caplog,
)
Expand Down
1 change: 1 addition & 0 deletions tests/application_celery/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
23 changes: 12 additions & 11 deletions tests/application_gearman/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (application_gearman)',
default_settings=_default_settings)
app_name="Python Agent Test (application_gearman)", default_settings=_default_settings
)
25 changes: 13 additions & 12 deletions tests/component_djangorestframework/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
'debug.log_autorum_middleware': True,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
"debug.log_autorum_middleware": True,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (component_djangorestframework)',
default_settings=_default_settings)
app_name="Python Agent Test (component_djangorestframework)", default_settings=_default_settings
)
25 changes: 13 additions & 12 deletions tests/component_flask_rest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
'transaction_tracer.explain_threshold': 0.0,
'transaction_tracer.transaction_threshold': 0.0,
'transaction_tracer.stack_trace_threshold': 0.0,
'debug.log_data_collector_payloads': True,
'debug.record_transaction_failure': True,
'debug.log_autorum_middleware': True,
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
"debug.log_data_collector_payloads": True,
"debug.record_transaction_failure": True,
"debug.log_autorum_middleware": True,
}

collector_agent_registration = collector_agent_registration_fixture(
app_name='Python Agent Test (component_flask_rest)',
default_settings=_default_settings)
app_name="Python Agent Test (component_flask_rest)", default_settings=_default_settings
)
7 changes: 5 additions & 2 deletions tests/component_graphqlserver/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from testing_support.fixtures import collector_agent_registration_fixture, collector_available_fixture # noqa: F401; pylint: disable=W0611

from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)

_default_settings = {
"package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs.
"transaction_tracer.explain_threshold": 0.0,
"transaction_tracer.transaction_threshold": 0.0,
"transaction_tracer.stack_trace_threshold": 0.0,
Expand Down
Loading

0 comments on commit d969238

Please sign in to comment.