Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(profiling): run native tests in ci #11108

Merged
merged 27 commits into from
Nov 12, 2024
Merged

Conversation

taegyunkim
Copy link
Contributor

@taegyunkim taegyunkim commented Oct 21, 2024

  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.
  2. 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

  • 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
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • 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 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

Copy link
Contributor

github-actions bot commented Oct 21, 2024

CODEOWNERS have been resolved as:

ddtrace/internal/datadog/profiling/test/.gitignore                      @DataDog/profiling-python
tests/profiling_v2/native_tests                                         @DataDog/profiling-python
.gitlab/package.yml                                                     @DataDog/python-guild @DataDog/apm-core-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/CMakeLists.txt       @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt         @DataDog/profiling-python
riotfile.py                                                             @DataDog/apm-python
setup.py                                                                @DataDog/python-guild
.riot/requirements/118a763.txt                                          @DataDog/apm-python
.riot/requirements/1359ebb.txt                                          @DataDog/apm-python
.riot/requirements/15e90ee.txt                                          @DataDog/apm-python
.riot/requirements/1600ae2.txt                                          @DataDog/apm-python
.riot/requirements/18008a7.txt                                          @DataDog/apm-python
.riot/requirements/1a9ec51.txt                                          @DataDog/apm-python
.riot/requirements/1b284db.txt                                          @DataDog/apm-python
.riot/requirements/1bc8c1c.txt                                          @DataDog/apm-python
.riot/requirements/1d20be2.txt                                          @DataDog/apm-python
.riot/requirements/1d21682.txt                                          @DataDog/apm-python
.riot/requirements/2e36381.txt                                          @DataDog/apm-python
.riot/requirements/4dd0ff3.txt                                          @DataDog/apm-python
.riot/requirements/6fe81be.txt                                          @DataDog/apm-python
.riot/requirements/a541d7e.txt                                          @DataDog/apm-python
.riot/requirements/b83f7ca.txt                                          @DataDog/apm-python
.riot/requirements/d2b6740.txt                                          @DataDog/apm-python
.riot/requirements/d3718d9.txt                                          @DataDog/apm-python
.riot/requirements/d62d369.txt                                          @DataDog/apm-python
.riot/requirements/f59e90e.txt                                          @DataDog/apm-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/test_api.cpp         @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/test_code_provenance.cpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/test_forking.cpp     @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/test_initialization.cpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/dd_wrapper/test/test_threading.cpp   @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/test/test_thread_span_links.cpp  @DataDog/profiling-python

@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Oct 21, 2024

Datadog Report

Branch report: taegyunkim/prof-10664-native-ci
Commit report: 95cfd6a
Test service: dd-trace-py

✅ 0 Failed, 592 Passed, 694 Skipped, 19m 15.94s Total duration (17m 34.75s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Oct 21, 2024

Benchmarks

Benchmark execution time: 2024-11-11 22:35:21

Comparing candidate commit 95cfd6a in PR branch taegyunkim/prof-10664-native-ci with baseline commit 498e125 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 388 metrics, 2 unstable metrics.

@taegyunkim taegyunkim changed the title add pytest-cpp chore(profiling): run native tests in ci Nov 7, 2024
@taegyunkim taegyunkim marked this pull request as ready for review November 8, 2024 15:36
@taegyunkim taegyunkim requested review from a team as code owners November 8, 2024 15:36
Copy link
Contributor

@sanchda sanchda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking this looks good and I really like how it works within the framework of our existing tests.

I left some comments about the use of RPATH, since this is loader-facing change which will affect how resolution occurs in customer environments. In practice I don't think this actually matters, so I'm not blocking the PR based on this feedback, but the general guidance is to minimize dependency resolution at dynamic load-time.

@taegyunkim taegyunkim added changelog/no-changelog A changelog entry is not required for this PR. Profiling Continous Profling labels Nov 11, 2024
@taegyunkim taegyunkim merged commit 66f7646 into main Nov 12, 2024
660 of 661 checks passed
@taegyunkim taegyunkim deleted the taegyunkim/prof-10664-native-ci branch November 12, 2024 14:34
quinna-h pushed a commit that referenced this pull request Nov 13, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR. Profiling Continous Profling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants