Skip to content

Commit

Permalink
chore(profiling): run native tests in ci (#11108)
Browse files Browse the repository at this point in the history
1. Use `pytest-cpp` to discover and run profiling C++ tests 
	a. `pytest-cpp` will find executables that start with `test_`
b. all tests are put into `ddtrace/internal/datadog/profiling/test` and
`tests/profiling_v2/native_test` will symlink to it for discovery.
3. `DD_PROFILING_NATIVE_TESTS` flag is used to build native tests
	a. needed to set this in `build_base_venv`
	b. setup.py includes native test binaries when the flag is set
	c. gitlab will also propagate those artifacts

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
  • Loading branch information
taegyunkim authored and quinna-h committed Nov 13, 2024
1 parent 1424b2d commit 4cf2aaf
Show file tree
Hide file tree
Showing 32 changed files with 177 additions and 117 deletions.
2 changes: 2 additions & 0 deletions .gitlab/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
19 changes: 10 additions & 9 deletions .riot/requirements/5286dd4.txt → .riot/requirements/15e90ee.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
19 changes: 10 additions & 9 deletions .riot/requirements/ab034bd.txt → .riot/requirements/1b284db.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@
# 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Loading

0 comments on commit 4cf2aaf

Please sign in to comment.