Skip to content

Commit a963649

Browse files
authored
Run coverage around pytest (#813)
* Run coverage around pytest * Trigger tests * Fixup * Add redis client_no_touch to ignore list * Temporarily remove kafka from coverage * Remove coverage for old libs
1 parent 3d82845 commit a963649

File tree

6 files changed

+17
-189
lines changed

6 files changed

+17
-189
lines changed

codecov.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ ignore:
1212
- "newrelic/hooks/framework_pylons.py"
1313
- "newrelic/hooks/framework_web2py.py"
1414
- "newrelic/hooks/middleware_weberror.py"
15+
- "newrelic/hooks/framework_webpy.py"
16+
- "newrelic/hooks/database_oursql.py"
17+
- "newrelic/hooks/database_psycopg2ct.py"
18+
- "newrelic/hooks/datastore_umemcache.py"
19+
# Temporarily disable kafka
20+
- "newrelic/hooks/messagebroker_kafkapython.py"
21+
- "newrelic/hooks/messagebroker_confluentkafka.py"

tests/datastore_aioredis/test_uninstrumented_methods.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"channels",
2020
"client_tracking_off",
2121
"client_tracking_on",
22+
"client_no_touch",
2223
"close",
2324
"closed",
2425
"connection_pool",

tests/datastore_redis/test_uninstrumented_methods.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@
1414

1515
import pytest
1616
import redis
17-
1817
from testing_support.db_settings import redis_settings
1918

2019
DB_SETTINGS = redis_settings()[0]
2120

22-
redis_client = redis.Redis(host=DB_SETTINGS['host'], port=DB_SETTINGS['port'], db=0)
23-
strict_redis_client = redis.StrictRedis(host=DB_SETTINGS['host'], port=DB_SETTINGS['port'], db=0)
21+
redis_client = redis.Redis(host=DB_SETTINGS["host"], port=DB_SETTINGS["port"], db=0)
22+
strict_redis_client = redis.StrictRedis(host=DB_SETTINGS["host"], port=DB_SETTINGS["port"], db=0)
2423

2524

2625
IGNORED_METHODS = {
27-
'MODULE_CALLBACKS',
28-
'MODULE_VERSION',
29-
'NAME',
26+
"MODULE_CALLBACKS",
27+
"MODULE_VERSION",
28+
"NAME",
3029
"add_edge",
3130
"add_node",
3231
"append_bucket_size",
@@ -44,6 +43,7 @@
4443
"BatchIndexer",
4544
"bulk",
4645
"call_procedure",
46+
"client_no_touch",
4747
"client_tracking_off",
4848
"client_tracking_on",
4949
"client",

tests/datastore_umemcache/conftest.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/datastore_umemcache/test_memcache.py

Lines changed: 0 additions & 143 deletions
This file was deleted.

tox.ini

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ envlist =
9898
redis-datastore_aredis-{py37,py38,py39,pypy37}-aredislatest,
9999
solr-datastore_solrpy-{py27,pypy}-solrpy{00,01},
100100
python-datastore_sqlite-{py27,py37,py38,py39,py310,py311,pypy,pypy37},
101-
memcached-datastore_umemcache-{py27,pypy},
102101
python-external_boto3-{py27,py37,py38,py39,py310,py311}-boto01,
103102
python-external_botocore-{py37,py38,py39,py310,py311}-botocorelatest,
104103
python-external_botocore-{py311}-botocore128,
@@ -173,7 +172,7 @@ deps =
173172
{py37,py38,py39,py310,py311,pypy37}: pytest==7.2.2
174173
{py27,pypy}: pytest==4.6.11
175174
iniconfig
176-
pytest-cov
175+
coverage
177176
WebTest==2.0.35
178177

179178
# Test Suite Dependencies
@@ -257,7 +256,6 @@ deps =
257256
datastore_aredis-aredislatest: aredis
258257
datastore_solrpy-solrpy00: solrpy<1.0
259258
datastore_solrpy-solrpy01: solrpy<2.0
260-
datastore_umemcache: umemcache<1.7
261259
external_boto3-boto01: boto3<2.0
262260
external_boto3-boto01: moto<2.0
263261
external_boto3-py27: rsa<4.7.1
@@ -389,7 +387,6 @@ setenv =
389387
with_extensions: NEW_RELIC_EXTENSIONS = true
390388
without_extensions: NEW_RELIC_EXTENSIONS = false
391389
agent_features: NEW_RELIC_APDEX_T = 1000
392-
datastore_umemcache: CFLAGS="-Wno-error"
393390
framework_grpc: PYTHONPATH={toxinidir}/tests/:{toxinidir}/tests/framework_grpc/sample_application
394391
libcurl: PYCURL_SSL_LIBRARY=openssl
395392
libcurl: LDFLAGS=-L/usr/local/opt/openssl/lib
@@ -409,8 +406,7 @@ commands =
409406
framework_grpc: /{toxinidir}/tests/framework_grpc/sample_application/sample_application.proto
410407

411408
libcurl: pip install --ignore-installed --config-settings="--build-option=--with-openssl" pycurl
412-
413-
py.test -v []
409+
coverage run -m pytest -v
414410

415411
install_command=
416412
# Older pip versions that support python 2 have issues with using the cache directory and cause crashes on GitHub Actions
@@ -458,7 +454,6 @@ changedir =
458454
datastore_aredis: tests/datastore_aredis
459455
datastore_solrpy: tests/datastore_solrpy
460456
datastore_sqlite: tests/datastore_sqlite
461-
datastore_umemcache: tests/datastore_umemcache
462457
external_boto3: tests/external_boto3
463458
external_botocore: tests/external_botocore
464459
external_feedparser: tests/external_feedparser
@@ -493,15 +488,14 @@ changedir =
493488
template_mako: tests/template_mako
494489

495490
[pytest]
496-
addopts = --cov="newrelic" --cov-report=html --cov-report=xml
497491
usefixtures =
498492
collector_available_fixture
499493
collector_agent_registration
500494

501495
[coverage:run]
502496
branch = True
503-
parallel = True
504497
disable_warnings = couldnt-parse
498+
source = newrelic
505499

506500
[coverage:paths]
507501
source =

0 commit comments

Comments
 (0)