From 952acbf6caef7f7259b779f5efc11278548709f2 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 16 Oct 2024 17:54:28 -0400 Subject: [PATCH 01/19] add pytest-cpp --- .../requirements/{13e7fea.txt => 1135503.txt} | 15 ++++++------ .../requirements/{5286dd4.txt => 15e90ee.txt} | 19 +++++++-------- .../requirements/{1744bab.txt => 1600ae2.txt} | 8 ++++--- .../requirements/{162ded5.txt => 1674ed0.txt} | 13 ++++++----- .../requirements/{18598d3.txt => 18008a7.txt} | 11 +++++---- .../requirements/{1f484c3.txt => 1a9ec51.txt} | 11 +++++---- .../requirements/{ab034bd.txt => 1b284db.txt} | 19 +++++++-------- .../requirements/{d6c4509.txt => 1bc8c1c.txt} | 13 ++++++----- .../requirements/{d79db4d.txt => 1d20be2.txt} | 15 ++++++------ .../requirements/{1e185ef.txt => 2e36381.txt} | 17 +++++++------- .../requirements/{c214c08.txt => 44b24ad.txt} | 7 +++--- .../requirements/{12526ba.txt => 4dd0ff3.txt} | 13 ++++++----- .../requirements/{7f8c636.txt => 6fe81be.txt} | 6 +++-- .../requirements/{1aecc60.txt => a541d7e.txt} | 9 ++++---- .../requirements/{ac92a08.txt => b2a399c.txt} | 15 ++++++------ .../requirements/{167dd48.txt => b83f7ca.txt} | 23 ++++++++++--------- .../requirements/{19c7eaf.txt => cc07a58.txt} | 9 ++++---- .../requirements/{8a0f886.txt => d2b6740.txt} | 6 +++-- .../requirements/{1e17619.txt => d3718d9.txt} | 15 ++++++------ .../requirements/{18d2618.txt => f59e90e.txt} | 17 +++++++------- riotfile.py | 1 + 21 files changed, 143 insertions(+), 119 deletions(-) rename .riot/requirements/{13e7fea.txt => 1135503.txt} (81%) rename .riot/requirements/{5286dd4.txt => 15e90ee.txt} (77%) rename .riot/requirements/{1744bab.txt => 1600ae2.txt} (85%) rename .riot/requirements/{162ded5.txt => 1674ed0.txt} (82%) rename .riot/requirements/{18598d3.txt => 18008a7.txt} (82%) rename .riot/requirements/{1f484c3.txt => 1a9ec51.txt} (83%) rename .riot/requirements/{ab034bd.txt => 1b284db.txt} (78%) rename .riot/requirements/{d6c4509.txt => 1bc8c1c.txt} (82%) rename .riot/requirements/{d79db4d.txt => 1d20be2.txt} (78%) rename .riot/requirements/{1e185ef.txt => 2e36381.txt} (78%) rename .riot/requirements/{c214c08.txt => 44b24ad.txt} (87%) rename .riot/requirements/{12526ba.txt => 4dd0ff3.txt} (81%) rename .riot/requirements/{7f8c636.txt => 6fe81be.txt} (86%) rename .riot/requirements/{1aecc60.txt => a541d7e.txt} (85%) rename .riot/requirements/{ac92a08.txt => b2a399c.txt} (80%) rename .riot/requirements/{167dd48.txt => b83f7ca.txt} (73%) rename .riot/requirements/{19c7eaf.txt => cc07a58.txt} (84%) rename .riot/requirements/{8a0f886.txt => d2b6740.txt} (84%) rename .riot/requirements/{1e17619.txt => d3718d9.txt} (79%) rename .riot/requirements/{18d2618.txt => f59e90e.txt} (75%) diff --git a/.riot/requirements/13e7fea.txt b/.riot/requirements/1135503.txt similarity index 81% rename from .riot/requirements/13e7fea.txt rename to .riot/requirements/1135503.txt index a9ae6e94a09..9a957f78952 100644 --- a/.riot/requirements/13e7fea.txt +++ b/.riot/requirements/1135503.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/13e7fea.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1135503.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 gevent==21.8.0 greenlet==1.1.0 @@ -18,17 +18,18 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 +tomli==2.0.2 +uwsgi==2.0.27 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/5286dd4.txt b/.riot/requirements/15e90ee.txt similarity index 77% rename from .riot/requirements/5286dd4.txt rename to .riot/requirements/15e90ee.txt index cfa763a35cf..1855f4db88a 100644 --- a/.riot/requirements/5286dd4.txt +++ b/.riot/requirements/15e90ee.txt @@ -2,13 +2,13 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/5286dd4.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/15e90ee.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 -gevent==24.2.1 -greenlet==3.0.3 +gevent==24.10.2 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -18,17 +18,18 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 +tomli==2.0.2 +uwsgi==2.0.27 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/1744bab.txt b/.riot/requirements/1600ae2.txt similarity index 85% rename from .riot/requirements/1744bab.txt rename to .riot/requirements/1600ae2.txt index 2b7720a4378..d330d767bc1 100644 --- a/.riot/requirements/1744bab.txt +++ b/.riot/requirements/1600ae2.txt @@ -2,13 +2,14 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/1744bab.in +# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/1600ae2.in # attrs==24.2.0 +colorama==0.4.6 coverage[toml]==7.2.7 exceptiongroup==1.2.2 gevent==22.10.2 -greenlet==3.0.3 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 importlib-metadata==6.7.0 @@ -23,12 +24,13 @@ pytest==7.4.4 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==4.1.0 +pytest-cpp==2.5.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 sortedcontainers==2.4.0 tomli==2.0.1 typing-extensions==4.7.1 -uwsgi==2.0.26 +uwsgi==2.0.27 zipp==3.15.0 zope-event==5.0 zope-interface==6.4.post2 diff --git a/.riot/requirements/162ded5.txt b/.riot/requirements/1674ed0.txt similarity index 82% rename from .riot/requirements/162ded5.txt rename to .riot/requirements/1674ed0.txt index 217ce12cc68..6a4789788e5 100644 --- a/.riot/requirements/162ded5.txt +++ b/.riot/requirements/1674ed0.txt @@ -2,12 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/162ded5.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1674ed0.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gevent==23.9.0 -greenlet==3.0.3 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -17,15 +17,16 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/18598d3.txt b/.riot/requirements/18008a7.txt similarity index 82% rename from .riot/requirements/18598d3.txt rename to .riot/requirements/18008a7.txt index 49e2a01fcd8..f27f68fb2ce 100644 --- a/.riot/requirements/18598d3.txt +++ b/.riot/requirements/18008a7.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/18598d3.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/18008a7.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gunicorn==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -14,13 +14,14 @@ mock==5.1.0 opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 -protobuf==5.28.0 +protobuf==5.28.2 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -uwsgi==2.0.26 +uwsgi==2.0.27 diff --git a/.riot/requirements/1f484c3.txt b/.riot/requirements/1a9ec51.txt similarity index 83% rename from .riot/requirements/1f484c3.txt rename to .riot/requirements/1a9ec51.txt index 8df64afa9f9..832fac60dff 100644 --- a/.riot/requirements/1f484c3.txt +++ b/.riot/requirements/1a9ec51.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1f484c3.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1a9ec51.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 @@ -17,12 +17,13 @@ packaging==24.1 pluggy==1.5.0 protobuf==3.19.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 +tomli==2.0.2 +uwsgi==2.0.27 diff --git a/.riot/requirements/ab034bd.txt b/.riot/requirements/1b284db.txt similarity index 78% rename from .riot/requirements/ab034bd.txt rename to .riot/requirements/1b284db.txt index 8189def48ce..890031e7402 100644 --- a/.riot/requirements/ab034bd.txt +++ b/.riot/requirements/1b284db.txt @@ -2,16 +2,16 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/ab034bd.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1b284db.in # attrs==24.2.0 coverage[toml]==7.6.1 exceptiongroup==1.2.2 gevent==24.2.1 -greenlet==3.0.3 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 @@ -19,18 +19,19 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/d6c4509.txt b/.riot/requirements/1bc8c1c.txt similarity index 82% rename from .riot/requirements/d6c4509.txt rename to .riot/requirements/1bc8c1c.txt index 833f8557797..163028cbf3e 100644 --- a/.riot/requirements/d6c4509.txt +++ b/.riot/requirements/1bc8c1c.txt @@ -2,14 +2,14 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/d6c4509.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1bc8c1c.in # attrs==24.2.0 coverage[toml]==7.6.1 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 @@ -18,13 +18,14 @@ packaging==24.1 pluggy==1.5.0 protobuf==3.19.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 diff --git a/.riot/requirements/d79db4d.txt b/.riot/requirements/1d20be2.txt similarity index 78% rename from .riot/requirements/d79db4d.txt rename to .riot/requirements/1d20be2.txt index 53f97535f4c..b3e24418d56 100644 --- a/.riot/requirements/d79db4d.txt +++ b/.riot/requirements/1d20be2.txt @@ -2,14 +2,14 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/d79db4d.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1d20be2.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 @@ -18,13 +18,14 @@ packaging==24.1 pluggy==1.5.0 protobuf==3.19.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 diff --git a/.riot/requirements/1e185ef.txt b/.riot/requirements/2e36381.txt similarity index 78% rename from .riot/requirements/1e185ef.txt rename to .riot/requirements/2e36381.txt index e358d5e4586..8629f1a5892 100644 --- a/.riot/requirements/1e185ef.txt +++ b/.riot/requirements/2e36381.txt @@ -2,12 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1e185ef.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/2e36381.in # attrs==24.2.0 -coverage[toml]==7.6.1 -gevent==24.2.1 -greenlet==3.0.3 +coverage[toml]==7.6.3 +gevent==24.10.2 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -17,16 +17,17 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -uwsgi==2.0.26 +uwsgi==2.0.27 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/c214c08.txt b/.riot/requirements/44b24ad.txt similarity index 87% rename from .riot/requirements/c214c08.txt rename to .riot/requirements/44b24ad.txt index c95c575f8f6..d47e64ef2a8 100644 --- a/.riot/requirements/c214c08.txt +++ b/.riot/requirements/44b24ad.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/c214c08.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/44b24ad.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gunicorn==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -16,10 +16,11 @@ packaging==24.1 pluggy==1.5.0 protobuf==4.22.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 diff --git a/.riot/requirements/12526ba.txt b/.riot/requirements/4dd0ff3.txt similarity index 81% rename from .riot/requirements/12526ba.txt rename to .riot/requirements/4dd0ff3.txt index ecee134c825..539971a6683 100644 --- a/.riot/requirements/12526ba.txt +++ b/.riot/requirements/4dd0ff3.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/12526ba.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/4dd0ff3.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 @@ -15,14 +15,15 @@ mock==5.1.0 opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 -protobuf==5.28.0 +protobuf==5.28.2 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 +tomli==2.0.2 +uwsgi==2.0.27 diff --git a/.riot/requirements/7f8c636.txt b/.riot/requirements/6fe81be.txt similarity index 86% rename from .riot/requirements/7f8c636.txt rename to .riot/requirements/6fe81be.txt index da175e96287..f49865ef3bd 100644 --- a/.riot/requirements/7f8c636.txt +++ b/.riot/requirements/6fe81be.txt @@ -2,9 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/7f8c636.in +# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/6fe81be.in # attrs==24.2.0 +colorama==0.4.6 coverage[toml]==7.2.7 exceptiongroup==1.2.2 gunicorn==23.0.0 @@ -22,13 +23,14 @@ pytest==7.4.4 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==4.1.0 +pytest-cpp==2.5.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 six==1.16.0 sortedcontainers==2.4.0 tomli==2.0.1 typing-extensions==4.7.1 -uwsgi==2.0.26 +uwsgi==2.0.27 zipp==3.15.0 # The following packages are considered to be unsafe in a requirements file: diff --git a/.riot/requirements/1aecc60.txt b/.riot/requirements/a541d7e.txt similarity index 85% rename from .riot/requirements/1aecc60.txt rename to .riot/requirements/a541d7e.txt index feb58960c23..8b110208b7f 100644 --- a/.riot/requirements/1aecc60.txt +++ b/.riot/requirements/a541d7e.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1aecc60.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/a541d7e.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gunicorn==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -16,11 +16,12 @@ packaging==24.1 pluggy==1.5.0 protobuf==4.22.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -uwsgi==2.0.26 +uwsgi==2.0.27 diff --git a/.riot/requirements/ac92a08.txt b/.riot/requirements/b2a399c.txt similarity index 80% rename from .riot/requirements/ac92a08.txt rename to .riot/requirements/b2a399c.txt index e1d20066e86..cdaa809d80c 100644 --- a/.riot/requirements/ac92a08.txt +++ b/.riot/requirements/b2a399c.txt @@ -2,12 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/ac92a08.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/b2a399c.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gevent==22.10.2 -greenlet==3.0.3 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -17,16 +17,17 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -uwsgi==2.0.26 +uwsgi==2.0.27 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/167dd48.txt b/.riot/requirements/b83f7ca.txt similarity index 73% rename from .riot/requirements/167dd48.txt rename to .riot/requirements/b83f7ca.txt index e3580c6518a..72d6ac027ea 100644 --- a/.riot/requirements/167dd48.txt +++ b/.riot/requirements/b83f7ca.txt @@ -2,16 +2,16 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/167dd48.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/b83f7ca.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 -gevent==24.2.1 -greenlet==3.0.3 +gevent==24.10.2 +greenlet==3.1.1 gunicorn[gevent]==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 @@ -19,18 +19,19 @@ opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 zope-event==5.0 -zope-interface==7.0.3 +zope-interface==7.1.0 # The following packages are considered to be unsafe in a requirements file: -setuptools==74.1.2 +setuptools==75.2.0 diff --git a/.riot/requirements/19c7eaf.txt b/.riot/requirements/cc07a58.txt similarity index 84% rename from .riot/requirements/19c7eaf.txt rename to .riot/requirements/cc07a58.txt index d6822dd6d82..79adb1aa8e6 100644 --- a/.riot/requirements/19c7eaf.txt +++ b/.riot/requirements/cc07a58.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/19c7eaf.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/cc07a58.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 gunicorn==23.0.0 hypothesis==6.45.0 iniconfig==2.0.0 @@ -14,12 +14,13 @@ mock==5.1.0 opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 -protobuf==5.28.0 +protobuf==5.28.2 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 diff --git a/.riot/requirements/8a0f886.txt b/.riot/requirements/d2b6740.txt similarity index 84% rename from .riot/requirements/8a0f886.txt rename to .riot/requirements/d2b6740.txt index 19b8536b36e..83fed7d33d5 100644 --- a/.riot/requirements/8a0f886.txt +++ b/.riot/requirements/d2b6740.txt @@ -2,9 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/8a0f886.in +# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/d2b6740.in # attrs==24.2.0 +colorama==0.4.6 coverage[toml]==7.2.7 exceptiongroup==1.2.2 gunicorn==23.0.0 @@ -22,10 +23,11 @@ pytest==7.4.4 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==4.1.0 +pytest-cpp==2.5.0 pytest-mock==3.11.1 pytest-randomly==3.12.0 sortedcontainers==2.4.0 tomli==2.0.1 typing-extensions==4.7.1 -uwsgi==2.0.26 +uwsgi==2.0.27 zipp==3.15.0 diff --git a/.riot/requirements/1e17619.txt b/.riot/requirements/d3718d9.txt similarity index 79% rename from .riot/requirements/1e17619.txt rename to .riot/requirements/d3718d9.txt index 11ba3494e76..83abce2c34c 100644 --- a/.riot/requirements/1e17619.txt +++ b/.riot/requirements/d3718d9.txt @@ -2,29 +2,30 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1e17619.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/d3718d9.in # attrs==24.2.0 coverage[toml]==7.6.1 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 -protobuf==5.28.0 +protobuf==5.28.2 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 diff --git a/.riot/requirements/18d2618.txt b/.riot/requirements/f59e90e.txt similarity index 75% rename from .riot/requirements/18d2618.txt rename to .riot/requirements/f59e90e.txt index b9b6eae6054..61250075c82 100644 --- a/.riot/requirements/18d2618.txt +++ b/.riot/requirements/f59e90e.txt @@ -2,29 +2,30 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/18d2618.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/f59e90e.in # attrs==24.2.0 -coverage[toml]==7.6.1 +coverage[toml]==7.6.3 exceptiongroup==1.2.2 gunicorn==23.0.0 hypothesis==6.45.0 -importlib-metadata==8.4.0 +importlib-metadata==8.5.0 iniconfig==2.0.0 lz4==4.3.3 mock==5.1.0 opentracing==2.4.0 packaging==24.1 pluggy==1.5.0 -protobuf==5.28.0 +protobuf==5.28.2 py-cpuinfo==8.0.0 -pytest==8.3.2 +pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==4.0.0 pytest-cov==5.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.15.0 sortedcontainers==2.4.0 -tomli==2.0.1 -uwsgi==2.0.26 -zipp==3.20.1 +tomli==2.0.2 +uwsgi==2.0.27 +zipp==3.20.2 diff --git a/riotfile.py b/riotfile.py index ec4006e3fbe..510eed6bd90 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2976,6 +2976,7 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): pkgs={ "gunicorn": latest, "lz4": latest, + "pytest-cpp": latest, # # pytest-benchmark depends on cpuinfo which dropped support for Python<=3.6 in 9.0 # See https://github.com/workhorsy/py-cpuinfo/issues/177 From 53a8b543d9aa4d3f24562875502155678f76606f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 17 Oct 2024 16:16:53 -0400 Subject: [PATCH 02/19] build testing --- riotfile.py | 6 +++++- setup.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/riotfile.py b/riotfile.py index 510eed6bd90..1d8ecd9875f 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2972,7 +2972,11 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): name="profile-v2", # NB riot commands that use this Venv must include --pass-env to work properly command="python -m tests.profiling.run pytest -v --no-cov --capture=no --benchmark-disable {cmdargs} tests/profiling_v2", # noqa: E501 - env={"DD_PROFILING_ENABLE_ASSERTS": "1", "DD_PROFILING_EXPORT_LIBDD_ENABLED": "1"}, + env={ + "DD_PROFILING_ENABLE_ASSERTS": "1", + "DD_PROFILING_EXPORT_LIBDD_ENABLED": "1", + "DD_PROFILInG_NATIVE_TESTS": "1", + }, pkgs={ "gunicorn": latest, "lz4": latest, diff --git a/setup.py b/setup.py index 7c8c90c6f1a..3e451c21bba 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,8 @@ CRASHTRACKER_DIR = HERE / "ddtrace" / "internal" / "datadog" / "profiling" / "crashtracker" STACK_V2_DIR = HERE / "ddtrace" / "internal" / "datadog" / "profiling" / "stack_v2" +BUILD_PROFILING_NATIVE_TESTS = os.getenv("DD_PROFILING_NATIVE_TESTS", "0").lower() in ("1", "yes", "on", "true") + CURRENT_OS = platform.system() LIBDDWAF_VERSION = "1.20.0" @@ -348,6 +350,9 @@ def build_extension_cmake(self, ext): "-DEXTENSION_NAME={}".format(extension_basename), ] + if BUILD_PROFILING_NATIVE_TESTS: + cmake_args += ["-DBUILD_TESTING=ON"] + # If it's been enabled, also propagate sccache to the CMake build. We have to manually set the default CC/CXX # compilers here, because otherwise the way we wrap sccache will conflict with the CMake wrappers sccache_path = os.getenv("DD_SCCACHE_PATH") From cc91c113fe0715c1c8f2dc8a66938cb6dcf81440 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 14:48:47 -0500 Subject: [PATCH 03/19] save --- .../datadog/profiling/dd_wrapper/test/CMakeLists.txt | 7 +++++++ .../datadog/profiling/stack_v2/test/CMakeLists.txt | 7 +++++++ ddtrace/internal/datadog/profiling/test/.gitignore | 2 ++ riotfile.py | 1 - setup.py | 4 +++- tests/profiling_v2/native_tests | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 ddtrace/internal/datadog/profiling/test/.gitignore create mode 120000 tests/profiling_v2/native_tests diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt index 9ff45b93108..13f810c13db 100644 --- a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt @@ -22,6 +22,13 @@ function(dd_wrapper_add_test name) add_ddup_config(${name}) gtest_discover_tests(${name}) + + if(LIB_INSTALL_DIR) + install(TARGETS ${name} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/../test + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/../test + RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../test) + endif() endfunction() # Add the tests diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt index 23fcda3eedb..26314eaf90b 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt @@ -19,6 +19,13 @@ function(dd_wrapper_add_test name) add_ddup_config(${name}) gtest_discover_tests(${name}) + + if(LIB_INSTALL_DIR) + install(TARGETS ${name} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}/../test + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/../test + RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../test) + endif() endfunction() # Add the tests diff --git a/ddtrace/internal/datadog/profiling/test/.gitignore b/ddtrace/internal/datadog/profiling/test/.gitignore new file mode 100644 index 00000000000..d6b7ef32c84 --- /dev/null +++ b/ddtrace/internal/datadog/profiling/test/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/riotfile.py b/riotfile.py index de4d2a9c85c..c991304143e 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2979,7 +2979,6 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): env={ "DD_PROFILING_ENABLE_ASSERTS": "1", "DD_PROFILING_EXPORT_LIBDD_ENABLED": "1", - "DD_PROFILInG_NATIVE_TESTS": "1", }, pkgs={ "gunicorn": latest, diff --git a/setup.py b/setup.py index eae3a4b32bc..ce1aa685596 100644 --- a/setup.py +++ b/setup.py @@ -572,7 +572,9 @@ def get_exts_for(name): "ddtrace.appsec": ["rules.json"], "ddtrace.appsec._ddwaf": ["libddwaf/*/lib/libddwaf.*"], "ddtrace.appsec._iast._taint_tracking": ["CMakeLists.txt"], - "ddtrace.internal.datadog.profiling": ["libdd_wrapper*.*"], + "ddtrace.internal.datadog.profiling": ( + ["libdd_wrapper*.*"] + ["ddtrace/internal/datadog/profiling/test/*"] if BUILD_PROFILING_NATIVE_TESTS else [] + ), "ddtrace.internal.datadog.profiling.crashtracker": ["crashtracker_exe*"], }, zip_safe=False, diff --git a/tests/profiling_v2/native_tests b/tests/profiling_v2/native_tests new file mode 120000 index 00000000000..9173c0212ba --- /dev/null +++ b/tests/profiling_v2/native_tests @@ -0,0 +1 @@ +../../ddtrace/internal/datadog/profiling/test \ No newline at end of file From 9081c8816f1bdd3f10408effe47983c61c8ed44f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 17:16:17 -0500 Subject: [PATCH 04/19] oh i hate cmake --- .../profiling/dd_wrapper/test/CMakeLists.txt | 4 ++-- .../datadog/profiling/stack_v2/CMakeLists.txt | 15 ++++++++++----- .../profiling/stack_v2/test/CMakeLists.txt | 12 +++++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt index 13f810c13db..3a70522e1e8 100644 --- a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt @@ -23,10 +23,10 @@ function(dd_wrapper_add_test name) gtest_discover_tests(${name}) + set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/..") + if(LIB_INSTALL_DIR) install(TARGETS ${name} - LIBRARY DESTINATION ${LIB_INSTALL_DIR}/../test - ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/../test RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../test) endif() endfunction() diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index 19f3955dab0..e75d92c9afd 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -96,16 +96,22 @@ endif() set_target_properties(${EXTENSION_NAME} PROPERTIES PREFIX "") set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") -# RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is -# typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) +# to discover dd_wrapper at runtime +set(RPATH_DIRS "$ORIGIN/..") + if(Python3_LIBRARIES) target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES}) + + # to discover Python at runtime + set(RPATH_DIRS "${RPATH_DIRS}:${Python3_RUNTIME_LIBRARY_DIRS}") endif() +# RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is +# typical. +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH ${RPATH_DIRS}) + # Extensions are built as dynamic libraries, so PIC is required. set_target_properties(${EXTENSION_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -122,4 +128,3 @@ if(BUILD_TESTING) enable_testing() add_subdirectory(test) endif() - diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt index 26314eaf90b..04077ee97bd 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt @@ -15,15 +15,21 @@ include(AnalysisFunc) function(dd_wrapper_add_test name) add_executable(${name} ${ARGN}) target_include_directories(${name} PRIVATE ../include) - target_link_libraries(${name} PRIVATE gmock gtest_main _stack_v2) + # this has to refer to the stack_v2 extension name to properly link against + target_link_libraries(${name} PRIVATE gmock gtest_main ${EXTENSION_NAME}) + set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/../stack_v2") + add_ddup_config(${name}) gtest_discover_tests(${name}) + # This is supplemental artifact so make sure to install it in the right place + if(INPLACE_LIB_INSTALL_DIR) + set(LIB_INSTALL_DIR "${INPLACE_LIB_INSTALL_DIR}") + endif() + if(LIB_INSTALL_DIR) install(TARGETS ${name} - LIBRARY DESTINATION ${LIB_INSTALL_DIR}/../test - ARCHIVE DESTINATION ${LIB_INSTALL_DIR}/../test RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../test) endif() endfunction() From 6f9ff8754f9e90f73b5270f1321b7f4dc3a5e2bd Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 17:20:45 -0500 Subject: [PATCH 05/19] rename test files to be discovered by pytest-cpp --- .../datadog/profiling/dd_wrapper/test/CMakeLists.txt | 10 +++++----- .../dd_wrapper/test/{api.cpp => test_api.cpp} | 0 .../{code_provenance.cpp => test_code_provenance.cpp} | 0 .../dd_wrapper/test/{forking.cpp => test_forking.cpp} | 0 .../{initialization.cpp => test_initialization.cpp} | 0 .../test/{threading.cpp => test_threading.cpp} | 0 .../datadog/profiling/stack_v2/test/CMakeLists.txt | 2 +- ...hread_span_links.cpp => test_thread_span_links.cpp} | 0 8 files changed, 6 insertions(+), 6 deletions(-) rename ddtrace/internal/datadog/profiling/dd_wrapper/test/{api.cpp => test_api.cpp} (100%) rename ddtrace/internal/datadog/profiling/dd_wrapper/test/{code_provenance.cpp => test_code_provenance.cpp} (100%) rename ddtrace/internal/datadog/profiling/dd_wrapper/test/{forking.cpp => test_forking.cpp} (100%) rename ddtrace/internal/datadog/profiling/dd_wrapper/test/{initialization.cpp => test_initialization.cpp} (100%) rename ddtrace/internal/datadog/profiling/dd_wrapper/test/{threading.cpp => test_threading.cpp} (100%) rename ddtrace/internal/datadog/profiling/stack_v2/test/{thread_span_links.cpp => test_thread_span_links.cpp} (100%) diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt index 3a70522e1e8..e7fe2ceb3ed 100644 --- a/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt @@ -32,8 +32,8 @@ function(dd_wrapper_add_test name) endfunction() # Add the tests -dd_wrapper_add_test(initialization initialization.cpp) -dd_wrapper_add_test(api api.cpp) -dd_wrapper_add_test(threading threading.cpp) -dd_wrapper_add_test(forking forking.cpp) -dd_wrapper_add_test(code_provenance code_provenance.cpp) +dd_wrapper_add_test(test_initialization test_initialization.cpp) +dd_wrapper_add_test(test_api test_api.cpp) +dd_wrapper_add_test(test_threading test_threading.cpp) +dd_wrapper_add_test(test_forking test_forking.cpp) +dd_wrapper_add_test(test_code_provenance test_code_provenance.cpp) diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/api.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_api.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/dd_wrapper/test/api.cpp rename to ddtrace/internal/datadog/profiling/dd_wrapper/test/test_api.cpp diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/code_provenance.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_code_provenance.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/dd_wrapper/test/code_provenance.cpp rename to ddtrace/internal/datadog/profiling/dd_wrapper/test/test_code_provenance.cpp diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/forking.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/dd_wrapper/test/forking.cpp rename to ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/initialization.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_initialization.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/dd_wrapper/test/initialization.cpp rename to ddtrace/internal/datadog/profiling/dd_wrapper/test/test_initialization.cpp diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/threading.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_threading.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/dd_wrapper/test/threading.cpp rename to ddtrace/internal/datadog/profiling/dd_wrapper/test/test_threading.cpp diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt index 04077ee97bd..dd8e149f54c 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt @@ -35,4 +35,4 @@ function(dd_wrapper_add_test name) endfunction() # Add the tests -dd_wrapper_add_test(thread_span_links thread_span_links.cpp) +dd_wrapper_add_test(test_thread_span_links test_thread_span_links.cpp) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/thread_span_links.cpp b/ddtrace/internal/datadog/profiling/stack_v2/test/test_thread_span_links.cpp similarity index 100% rename from ddtrace/internal/datadog/profiling/stack_v2/test/thread_span_links.cpp rename to ddtrace/internal/datadog/profiling/stack_v2/test/test_thread_span_links.cpp From a4d243cb7e18704042fcfe28f7b7a47116a5ca51 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 17:26:43 -0500 Subject: [PATCH 06/19] ugh it needs to be set as part of the build base venv --- .gitlab/package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/package.yml b/.gitlab/package.yml index 115ada9f264..4a39977a562 100644 --- a/.gitlab/package.yml +++ b/.gitlab/package.yml @@ -7,6 +7,7 @@ build_base_venvs: variables: CMAKE_BUILD_PARALLEL_LEVEL: 12 PIP_VERBOSE: 1 + DD_PROFILING_NATIVE_TESTS: 1 script: - pip install riot==0.20.0 - riot -P -v generate --python=$PYTHON_VERSION From f977be5c1c1a0480889d0844aa2457cb8f32313f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 17:37:17 -0500 Subject: [PATCH 07/19] update artifact --- .gitlab/package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/package.yml b/.gitlab/package.yml index 4a39977a562..2f896637599 100644 --- a/.gitlab/package.yml +++ b/.gitlab/package.yml @@ -17,6 +17,7 @@ build_base_venvs: - .riot/venv_* - ddtrace/**/*.so* - ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe* + - ddtrace/internal/datadog/profiling/test/test_* download_ddtrace_artifacts: image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0 From 2925366dc5312ceda92ff8da400a672dad828863 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 17:54:10 -0500 Subject: [PATCH 08/19] update --- .../requirements/{acb0de0.txt => 118a763.txt} | 11 ++++--- .../requirements/{c351d44.txt => 14f175d.txt} | 13 ++++---- .riot/requirements/1674ed0.txt | 32 ------------------- .riot/requirements/44b24ad.txt | 26 --------------- .riot/requirements/cc07a58.txt | 26 --------------- .../requirements/{11aeb6a.txt => d62d369.txt} | 11 ++++--- 6 files changed, 19 insertions(+), 100 deletions(-) rename .riot/requirements/{acb0de0.txt => 118a763.txt} (79%) rename .riot/requirements/{c351d44.txt => 14f175d.txt} (81%) delete mode 100644 .riot/requirements/1674ed0.txt delete mode 100644 .riot/requirements/44b24ad.txt delete mode 100644 .riot/requirements/cc07a58.txt rename .riot/requirements/{11aeb6a.txt => d62d369.txt} (79%) diff --git a/.riot/requirements/acb0de0.txt b/.riot/requirements/118a763.txt similarity index 79% rename from .riot/requirements/acb0de0.txt rename to .riot/requirements/118a763.txt index 5717bdd07bc..96dddb83cd5 100644 --- a/.riot/requirements/acb0de0.txt +++ b/.riot/requirements/118a763.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/acb0de0.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/118a763.in # attrs==24.2.0 coverage[toml]==7.6.4 @@ -18,9 +18,10 @@ protobuf==5.28.3 py-cpuinfo==8.0.0 pytest==8.3.3 pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 +pytest-benchmark==5.1.0 +pytest-cov==6.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 -pytest-randomly==3.15.0 +pytest-randomly==3.16.0 sortedcontainers==2.4.0 -uwsgi==2.0.27 +uwsgi==2.0.28 diff --git a/.riot/requirements/c351d44.txt b/.riot/requirements/14f175d.txt similarity index 81% rename from .riot/requirements/c351d44.txt rename to .riot/requirements/14f175d.txt index 363b32208e7..4bfa308cf75 100644 --- a/.riot/requirements/c351d44.txt +++ b/.riot/requirements/14f175d.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/c351d44.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/14f175d.in # attrs==24.2.0 coverage[toml]==7.6.4 @@ -19,14 +19,15 @@ pluggy==1.5.0 py-cpuinfo==8.0.0 pytest==8.3.3 pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 +pytest-benchmark==5.1.0 +pytest-cov==6.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 -pytest-randomly==3.15.0 +pytest-randomly==3.16.0 sortedcontainers==2.4.0 -uwsgi==2.0.27 +uwsgi==2.0.28 zope-event==5.0 zope-interface==7.1.1 # The following packages are considered to be unsafe in a requirements file: -setuptools==75.2.0 +setuptools==75.3.0 diff --git a/.riot/requirements/1674ed0.txt b/.riot/requirements/1674ed0.txt deleted file mode 100644 index 6a4789788e5..00000000000 --- a/.riot/requirements/1674ed0.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1674ed0.in -# -attrs==24.2.0 -coverage[toml]==7.6.3 -gevent==23.9.0 -greenlet==3.1.1 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -zope-event==5.0 -zope-interface==7.1.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==75.2.0 diff --git a/.riot/requirements/44b24ad.txt b/.riot/requirements/44b24ad.txt deleted file mode 100644 index d47e64ef2a8..00000000000 --- a/.riot/requirements/44b24ad.txt +++ /dev/null @@ -1,26 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/44b24ad.in -# -attrs==24.2.0 -coverage[toml]==7.6.3 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -protobuf==4.22.0 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 diff --git a/.riot/requirements/cc07a58.txt b/.riot/requirements/cc07a58.txt deleted file mode 100644 index 79adb1aa8e6..00000000000 --- a/.riot/requirements/cc07a58.txt +++ /dev/null @@ -1,26 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/cc07a58.in -# -attrs==24.2.0 -coverage[toml]==7.6.3 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -protobuf==5.28.2 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 diff --git a/.riot/requirements/11aeb6a.txt b/.riot/requirements/d62d369.txt similarity index 79% rename from .riot/requirements/11aeb6a.txt rename to .riot/requirements/d62d369.txt index 9107c0564a8..4e6a1334fb6 100644 --- a/.riot/requirements/11aeb6a.txt +++ b/.riot/requirements/d62d369.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/11aeb6a.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/d62d369.in # attrs==24.2.0 coverage[toml]==7.6.4 @@ -18,9 +18,10 @@ protobuf==4.22.0 py-cpuinfo==8.0.0 pytest==8.3.3 pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 +pytest-benchmark==5.1.0 +pytest-cov==6.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 -pytest-randomly==3.15.0 +pytest-randomly==3.16.0 sortedcontainers==2.4.0 -uwsgi==2.0.27 +uwsgi==2.0.28 From a3eea412491129e96b08aac354bcd6deec2a8868 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 20:49:41 -0500 Subject: [PATCH 09/19] ignore non pytest items --- ddtrace/contrib/pytest/_plugin_v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index a3a3b504b00..77ffdc6ce3b 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -578,7 +578,7 @@ def pytest_collection_modifyitems(session, config, items): @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_protocol(item, nextitem): - if not _CIVisibility.enabled: + if not _CIVisibility.enabled or not isinstance(item, (pytest.Package, pytest.Module)): yield return From e2f518aaed11295955ad694dac9d6ecbf54999cd Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 7 Nov 2024 20:58:05 -0500 Subject: [PATCH 10/19] try this way --- ddtrace/contrib/pytest/_plugin_v1.py | 29 ++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index 77ffdc6ce3b..fc8b6dac470 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -11,6 +11,7 @@ expected failures. """ + from doctest import DocTest import json import os @@ -130,7 +131,8 @@ def _extract_ancestor_suite_span(item): def _store_module_span(item, span): """Store span at `pytest.Item` instance.""" - item._datadog_span_module = span + if item: + item._datadog_span_module = span def _mark_failed(item): @@ -260,7 +262,7 @@ def _get_module_path(item): """Extract module path from a `pytest.Item` instance.""" # type (pytest.Item) -> str if not isinstance(item, (pytest.Package, pytest.Module)): - return None + return "" if _is_pytest_8_or_later() and isinstance(item, pytest.Package): module_path = item.nodeid @@ -274,7 +276,9 @@ def _get_module_path(item): def _module_is_package(pytest_package_item=None, pytest_module_item=None): # Pytest 8+ module items have a pytest.Dir object as their parent instead of the session object if _is_pytest_8_or_later(): - return isinstance(pytest_module_item.parent, pytest.Package) + if pytest_module_item: + return isinstance(pytest_module_item.parent, pytest.Package) + return False if pytest_package_item is None and pytest_module_item is not None: return False @@ -578,7 +582,7 @@ def pytest_collection_modifyitems(session, config, items): @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_protocol(item, nextitem): - if not _CIVisibility.enabled or not isinstance(item, (pytest.Package, pytest.Module)): + if not _CIVisibility.enabled: yield return @@ -666,7 +670,8 @@ def pytest_runtest_protocol(item, nextitem): span.set_tag_str(test.MODULE, test_module_span.get_tag(test.MODULE)) span.set_tag_str(test.MODULE_PATH, test_module_path) - span.set_tag_str(_SUITE_ID, str(test_suite_span.span_id)) + if test_suite_span: + span.set_tag_str(_SUITE_ID, str(test_suite_span.span_id)) test_class_hierarchy = _get_test_class_hierarchy(item) if test_class_hierarchy: span.set_tag_str(test.CLASS_HIERARCHY, test_class_hierarchy) @@ -674,8 +679,9 @@ def pytest_runtest_protocol(item, nextitem): test_suite_name = "{}.py".format(item.dtest.globs["__name__"]) span.set_tag_str(test.SUITE, test_suite_name) else: - test_suite_name = test_suite_span.get_tag(test.SUITE) - span.set_tag_str(test.SUITE, test_suite_name) + if test_suite_span: + test_suite_name = test_suite_span.get_tag(test.SUITE) + span.set_tag_str(test.SUITE, test_suite_name) span.set_tag_str(test.TYPE, SpanTypes.TEST) span.set_tag_str(test.FRAMEWORK_VERSION, pytest.__version__) @@ -747,7 +753,12 @@ def pytest_runtest_protocol(item, nextitem): _report_coverage_to_span(pytest._dd_coverage, span, root_directory, TEST_FRAMEWORKS.PYTEST) nextitem_pytest_module_item = _find_pytest_item(nextitem, pytest.Module) - if nextitem is None or nextitem_pytest_module_item != pytest_module_item and not test_suite_span.finished: + if ( + nextitem is None + or nextitem_pytest_module_item != pytest_module_item + and test_suite_span is not None + and not test_suite_span.finished + ): _mark_test_status(pytest_module_item, test_suite_span) # Finish coverage for the test suite if coverage is enabled # In ITR suite skipping mode, all tests in a skipped suite should be marked @@ -848,6 +859,8 @@ def pytest_runtest_makereport(item, call): @pytest.hookimpl(trylast=True) def pytest_ddtrace_get_item_module_name(item): pytest_module_item = _find_pytest_item(item, pytest.Module) + if not pytest_module_item: + return "" pytest_package_item = _find_pytest_item(pytest_module_item, pytest.Package) if _module_is_package(pytest_package_item, pytest_module_item): From fa7ca4019e67c5b37ff84f0c7de339831dfa42a6 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 8 Nov 2024 09:59:01 -0500 Subject: [PATCH 11/19] Discard changes to ddtrace/contrib/pytest/_plugin_v1.py --- ddtrace/contrib/pytest/_plugin_v1.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index fc8b6dac470..a3a3b504b00 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -11,7 +11,6 @@ expected failures. """ - from doctest import DocTest import json import os @@ -131,8 +130,7 @@ def _extract_ancestor_suite_span(item): def _store_module_span(item, span): """Store span at `pytest.Item` instance.""" - if item: - item._datadog_span_module = span + item._datadog_span_module = span def _mark_failed(item): @@ -262,7 +260,7 @@ def _get_module_path(item): """Extract module path from a `pytest.Item` instance.""" # type (pytest.Item) -> str if not isinstance(item, (pytest.Package, pytest.Module)): - return "" + return None if _is_pytest_8_or_later() and isinstance(item, pytest.Package): module_path = item.nodeid @@ -276,9 +274,7 @@ def _get_module_path(item): def _module_is_package(pytest_package_item=None, pytest_module_item=None): # Pytest 8+ module items have a pytest.Dir object as their parent instead of the session object if _is_pytest_8_or_later(): - if pytest_module_item: - return isinstance(pytest_module_item.parent, pytest.Package) - return False + return isinstance(pytest_module_item.parent, pytest.Package) if pytest_package_item is None and pytest_module_item is not None: return False @@ -670,8 +666,7 @@ def pytest_runtest_protocol(item, nextitem): span.set_tag_str(test.MODULE, test_module_span.get_tag(test.MODULE)) span.set_tag_str(test.MODULE_PATH, test_module_path) - if test_suite_span: - span.set_tag_str(_SUITE_ID, str(test_suite_span.span_id)) + span.set_tag_str(_SUITE_ID, str(test_suite_span.span_id)) test_class_hierarchy = _get_test_class_hierarchy(item) if test_class_hierarchy: span.set_tag_str(test.CLASS_HIERARCHY, test_class_hierarchy) @@ -679,9 +674,8 @@ def pytest_runtest_protocol(item, nextitem): test_suite_name = "{}.py".format(item.dtest.globs["__name__"]) span.set_tag_str(test.SUITE, test_suite_name) else: - if test_suite_span: - test_suite_name = test_suite_span.get_tag(test.SUITE) - span.set_tag_str(test.SUITE, test_suite_name) + test_suite_name = test_suite_span.get_tag(test.SUITE) + span.set_tag_str(test.SUITE, test_suite_name) span.set_tag_str(test.TYPE, SpanTypes.TEST) span.set_tag_str(test.FRAMEWORK_VERSION, pytest.__version__) @@ -753,12 +747,7 @@ def pytest_runtest_protocol(item, nextitem): _report_coverage_to_span(pytest._dd_coverage, span, root_directory, TEST_FRAMEWORKS.PYTEST) nextitem_pytest_module_item = _find_pytest_item(nextitem, pytest.Module) - if ( - nextitem is None - or nextitem_pytest_module_item != pytest_module_item - and test_suite_span is not None - and not test_suite_span.finished - ): + if nextitem is None or nextitem_pytest_module_item != pytest_module_item and not test_suite_span.finished: _mark_test_status(pytest_module_item, test_suite_span) # Finish coverage for the test suite if coverage is enabled # In ITR suite skipping mode, all tests in a skipped suite should be marked @@ -859,8 +848,6 @@ def pytest_runtest_makereport(item, call): @pytest.hookimpl(trylast=True) def pytest_ddtrace_get_item_module_name(item): pytest_module_item = _find_pytest_item(item, pytest.Module) - if not pytest_module_item: - return "" pytest_package_item = _find_pytest_item(pytest_module_item, pytest.Package) if _module_is_package(pytest_package_item, pytest_module_item): From 71dffc089bd1fc98c4092c23c1c9ea66fd36822f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 8 Nov 2024 10:00:05 -0500 Subject: [PATCH 12/19] ignore pytest cpp item --- ddtrace/contrib/pytest/_plugin_v1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index a3a3b504b00..3a55cfd8fb2 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -582,6 +582,16 @@ def pytest_runtest_protocol(item, nextitem): yield return + try: + import pytest_cpp + + if isinstance(item, isinstance(pytest_cpp.CppItem)): + yield + return + except Exception: + # only some test suites have pytest_cpp installed + pass + is_skipped = bool( item.get_closest_marker("skip") or any([marker for marker in item.iter_markers(name="skipif") if marker.args[0] is True]) From fee2f6cc1d2d4682cb2fa0d40c9ad26df81ef197 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 8 Nov 2024 10:34:17 -0500 Subject: [PATCH 13/19] simplify --- ddtrace/contrib/pytest/_plugin_v1.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index 3a55cfd8fb2..aa6aebfa192 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -11,6 +11,7 @@ expected failures. """ + from doctest import DocTest import json import os @@ -74,6 +75,17 @@ log = get_logger(__name__) + +PYTEST_CPP_ENABLED = False + +try: + import pytest_cpp + + PYTEST_CPP_ENABLED = True +except ImportError: + log.debug("pytest-cpp not installed, it's only installed for profiling suites") + + _global_skipped_elements = 0 # COVER_SESSION is an experimental feature flag that provides full coverage (similar to coverage run), and is an @@ -582,15 +594,9 @@ def pytest_runtest_protocol(item, nextitem): yield return - try: - import pytest_cpp - - if isinstance(item, isinstance(pytest_cpp.CppItem)): - yield - return - except Exception: - # only some test suites have pytest_cpp installed - pass + if PYTEST_CPP_ENABLED and isinstance(item, pytest_cpp.plugin.CppItem): + yield + return is_skipped = bool( item.get_closest_marker("skip") From 41104200804678c1fa7160cefc87dd7b68e28046 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 8 Nov 2024 14:57:49 -0500 Subject: [PATCH 14/19] Discard changes to ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt --- .../datadog/profiling/stack_v2/CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index e75d92c9afd..19f3955dab0 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -96,22 +96,16 @@ endif() set_target_properties(${EXTENSION_NAME} PROPERTIES PREFIX "") set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") -target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) +# RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is +# typical. +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") -# to discover dd_wrapper at runtime -set(RPATH_DIRS "$ORIGIN/..") +target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) if(Python3_LIBRARIES) target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES}) - - # to discover Python at runtime - set(RPATH_DIRS "${RPATH_DIRS}:${Python3_RUNTIME_LIBRARY_DIRS}") endif() -# RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is -# typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH ${RPATH_DIRS}) - # Extensions are built as dynamic libraries, so PIC is required. set_target_properties(${EXTENSION_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -128,3 +122,4 @@ if(BUILD_TESTING) enable_testing() add_subdirectory(test) endif() + From fa28c05660fb0fcae0b55a98a6586e3c1f0ca3a7 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 8 Nov 2024 20:42:32 +0000 Subject: [PATCH 15/19] use ddup_upload() --- .../internal/datadog/profiling/dd_wrapper/test/test_forking.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp index e7af54abc10..e02849248e6 100644 --- a/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp +++ b/ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp @@ -64,7 +64,7 @@ sample_in_threads_and_fork(unsigned int num_threads, unsigned int sleep_time_ns) int status; done.store(true); waitpid(pid, &status, 0); - upload_in_thread(); + ddup_upload(); if (!is_exit_normal(status)) { std::exit(1); } From 32c5c8499108af619f7993d712e8f9d93b4b419b Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 11 Nov 2024 19:15:43 +0000 Subject: [PATCH 16/19] synchronized sample pool reset after fork --- .../datadog/profiling/dd_wrapper/src/sample_manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ddtrace/internal/datadog/profiling/dd_wrapper/src/sample_manager.cpp b/ddtrace/internal/datadog/profiling/dd_wrapper/src/sample_manager.cpp index 310bf3b95bd..ca355cac97c 100644 --- a/ddtrace/internal/datadog/profiling/dd_wrapper/src/sample_manager.cpp +++ b/ddtrace/internal/datadog/profiling/dd_wrapper/src/sample_manager.cpp @@ -74,6 +74,12 @@ void Datadog::SampleManager::postfork_child() { Datadog::Sample::postfork_child(); + if (sample_pool != nullptr) { + // Clear the pool to make sure it's in a consistent state. + // Suppose there was a thread that was adding/removing sample from the pool + // and the fork happened in the middle of that operation. + sample_pool = std::make_unique(sample_pool_capacity); + } } void From 2b1f9e9fccadf49714fc68ffe677161d698c1c02 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 11 Nov 2024 15:22:15 -0500 Subject: [PATCH 17/19] Discard changes to ddtrace/contrib/pytest/_plugin_v1.py --- ddtrace/contrib/pytest/_plugin_v1.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ddtrace/contrib/pytest/_plugin_v1.py b/ddtrace/contrib/pytest/_plugin_v1.py index aa6aebfa192..a3a3b504b00 100644 --- a/ddtrace/contrib/pytest/_plugin_v1.py +++ b/ddtrace/contrib/pytest/_plugin_v1.py @@ -11,7 +11,6 @@ expected failures. """ - from doctest import DocTest import json import os @@ -75,17 +74,6 @@ log = get_logger(__name__) - -PYTEST_CPP_ENABLED = False - -try: - import pytest_cpp - - PYTEST_CPP_ENABLED = True -except ImportError: - log.debug("pytest-cpp not installed, it's only installed for profiling suites") - - _global_skipped_elements = 0 # COVER_SESSION is an experimental feature flag that provides full coverage (similar to coverage run), and is an @@ -594,10 +582,6 @@ def pytest_runtest_protocol(item, nextitem): yield return - if PYTEST_CPP_ENABLED and isinstance(item, pytest_cpp.plugin.CppItem): - yield - return - is_skipped = bool( item.get_closest_marker("skip") or any([marker for marker in item.iter_markers(name="skipif") if marker.args[0] is True]) From 5d72391fc21f7a69119b910b144b6d6fa3fe872c Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 11 Nov 2024 20:22:03 +0000 Subject: [PATCH 18/19] use pytest v2 plugin --- .riot/requirements/1135503.txt | 35 ------------------- .../requirements/{1452073.txt => 1359ebb.txt} | 7 ++-- .riot/requirements/14f175d.txt | 33 ----------------- .../requirements/{eb59b31.txt => 1d21682.txt} | 5 +-- .riot/requirements/b2a399c.txt | 33 ----------------- riotfile.py | 2 ++ 6 files changed, 9 insertions(+), 106 deletions(-) delete mode 100644 .riot/requirements/1135503.txt rename .riot/requirements/{1452073.txt => 1359ebb.txt} (91%) delete mode 100644 .riot/requirements/14f175d.txt rename .riot/requirements/{eb59b31.txt => 1d21682.txt} (93%) delete mode 100644 .riot/requirements/b2a399c.txt diff --git a/.riot/requirements/1135503.txt b/.riot/requirements/1135503.txt deleted file mode 100644 index 9a957f78952..00000000000 --- a/.riot/requirements/1135503.txt +++ /dev/null @@ -1,35 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1135503.in -# -attrs==24.2.0 -coverage[toml]==7.6.3 -exceptiongroup==1.2.2 -gevent==21.8.0 -greenlet==1.1.0 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.2 -uwsgi==2.0.27 -zope-event==5.0 -zope-interface==7.1.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==75.2.0 diff --git a/.riot/requirements/1452073.txt b/.riot/requirements/1359ebb.txt similarity index 91% rename from .riot/requirements/1452073.txt rename to .riot/requirements/1359ebb.txt index e2c59087863..75c10c261a8 100644 --- a/.riot/requirements/1452073.txt +++ b/.riot/requirements/1359ebb.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1452073.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1359ebb.in # attrs==24.2.0 coverage[toml]==7.6.4 @@ -22,13 +22,14 @@ pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==5.1.0 pytest-cov==6.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.16.0 sortedcontainers==2.4.0 -tomli==2.0.2 +tomli==2.1.0 uwsgi==2.0.28 zope-event==5.0 zope-interface==7.1.1 # The following packages are considered to be unsafe in a requirements file: -setuptools==75.3.0 +setuptools==75.4.0 diff --git a/.riot/requirements/14f175d.txt b/.riot/requirements/14f175d.txt deleted file mode 100644 index 4bfa308cf75..00000000000 --- a/.riot/requirements/14f175d.txt +++ /dev/null @@ -1,33 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/14f175d.in -# -attrs==24.2.0 -coverage[toml]==7.6.4 -gevent==23.9.0 -greenlet==3.1.1 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==5.1.0 -pytest-cov==6.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.16.0 -sortedcontainers==2.4.0 -uwsgi==2.0.28 -zope-event==5.0 -zope-interface==7.1.1 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==75.3.0 diff --git a/.riot/requirements/eb59b31.txt b/.riot/requirements/1d21682.txt similarity index 93% rename from .riot/requirements/eb59b31.txt rename to .riot/requirements/1d21682.txt index 5899a214883..93fd622b954 100644 --- a/.riot/requirements/eb59b31.txt +++ b/.riot/requirements/1d21682.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile --allow-unsafe --no-annotate .riot/requirements/eb59b31.in +# pip-compile --allow-unsafe --no-annotate .riot/requirements/1d21682.in # attrs==24.2.0 coverage[toml]==7.6.4 @@ -21,6 +21,7 @@ pytest==8.3.3 pytest-asyncio==0.21.1 pytest-benchmark==5.1.0 pytest-cov==6.0.0 +pytest-cpp==2.6.0 pytest-mock==3.14.0 pytest-randomly==3.16.0 sortedcontainers==2.4.0 @@ -29,4 +30,4 @@ zope-event==5.0 zope-interface==7.1.1 # The following packages are considered to be unsafe in a requirements file: -setuptools==75.3.0 +setuptools==75.4.0 diff --git a/.riot/requirements/b2a399c.txt b/.riot/requirements/b2a399c.txt deleted file mode 100644 index cdaa809d80c..00000000000 --- a/.riot/requirements/b2a399c.txt +++ /dev/null @@ -1,33 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/b2a399c.in -# -attrs==24.2.0 -coverage[toml]==7.6.3 -gevent==22.10.2 -greenlet==3.1.1 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -lz4==4.3.3 -mock==5.1.0 -opentracing==2.4.0 -packaging==24.1 -pluggy==1.5.0 -py-cpuinfo==8.0.0 -pytest==8.3.3 -pytest-asyncio==0.21.1 -pytest-benchmark==4.0.0 -pytest-cov==5.0.0 -pytest-cpp==2.6.0 -pytest-mock==3.14.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -uwsgi==2.0.27 -zope-event==5.0 -zope-interface==7.1.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==75.2.0 diff --git a/riotfile.py b/riotfile.py index 56286a42d46..c509aa7d8b0 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2962,6 +2962,8 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): env={ "DD_PROFILING_ENABLE_ASSERTS": "1", "DD_PROFILING_EXPORT_LIBDD_ENABLED": "1", + # Enable pytest v2 plugin to handle pytest-cpp items in the test suite + " _DD_CIVISIBILITY_USE_PYTEST_V2": "1", }, pkgs={ "gunicorn": latest, From a7c463161f53ca34b2e00cc71ed70f31b2bd8133 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 11 Nov 2024 16:40:06 -0500 Subject: [PATCH 19/19] fix typo --- riotfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riotfile.py b/riotfile.py index c509aa7d8b0..e7babcae672 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2963,7 +2963,7 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION): "DD_PROFILING_ENABLE_ASSERTS": "1", "DD_PROFILING_EXPORT_LIBDD_ENABLED": "1", # Enable pytest v2 plugin to handle pytest-cpp items in the test suite - " _DD_CIVISIBILITY_USE_PYTEST_V2": "1", + "_DD_CIVISIBILITY_USE_PYTEST_V2": "1", }, pkgs={ "gunicorn": latest,