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(iast): add google testing for the native IAST module #10600

Merged
merged 27 commits into from
Sep 13, 2024

Conversation

juanjux
Copy link
Collaborator

@juanjux juanjux commented Sep 10, 2024

Description

Add unittesting using GoogleTest for the native code (which libddwaf and profiling also use). Also moves some code around to make it easier to test (to header files as inline usually) and fixes a couple issues that the unittesting found.

For future PRs:

  • Coverage.

Signed-off-by: Juanjo Alvarez [email protected]

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

Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
@juanjux juanjux added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Sep 10, 2024
@juanjux juanjux self-assigned this Sep 10, 2024
Copy link
Contributor

github-actions bot commented Sep 10, 2024

CODEOWNERS have been resolved as:

ddtrace/appsec/_iast/_taint_tracking/tests/CMakeLists.txt               @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/tests/test_helpers.cpp             @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/tests/test_stringutils.cpp         @DataDog/asm-python
.gitlab/tests/appsec.yml                                                @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/Aspects/AspectsOsPath.cpp          @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/Aspects/Helpers.cpp                @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/Aspects/Helpers.h                  @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/CMakeLists.txt                     @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/Utils/StringUtils.cpp              @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/Utils/StringUtils.h                @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/clean.sh                           @DataDog/asm-python
hatch.toml                                                              @DataDog/python-guild
tests/.suitespec.json                                                   @DataDog/python-guild @DataDog/apm-core-python
tests/appsec/iast/aspects/test_aspect_helpers.py                        @DataDog/asm-python

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

datadog-dd-trace-py-rkomorn bot commented Sep 10, 2024

Datadog Report

Branch report: juanjux/APPSEC-54599-native-unittesting
Commit report: 36260bd
Test service: dd-trace-py

✅ 0 Failed, 6491 Passed, 218 Skipped, 1h 34m 0.21s Total duration (1m 43.19s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Sep 10, 2024

Benchmarks

Benchmark execution time: 2024-09-13 09:16:03

Comparing candidate commit 36260bd in PR branch juanjux/APPSEC-54599-native-unittesting with baseline commit 15a9399 in branch main.

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

@juanjux juanjux marked this pull request as ready for review September 12, 2024 10:42
@juanjux juanjux requested review from a team as code owners September 12, 2024 10:42
@juanjux juanjux requested a review from tabgok September 12, 2024 10:42
@juanjux juanjux closed this Sep 12, 2024
@juanjux juanjux reopened this Sep 12, 2024
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
@juanjux juanjux requested a review from a team as a code owner September 12, 2024 13:10
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Signed-off-by: Juanjo Alvarez <[email protected]>
Copy link
Member

@avara1986 avara1986 left a comment

Choose a reason for hiding this comment

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

LGTM

@juanjux juanjux enabled auto-merge (squash) September 13, 2024 08:44
@juanjux juanjux merged commit ff2206a into main Sep 13, 2024
627 of 629 checks passed
@juanjux juanjux deleted the juanjux/APPSEC-54599-native-unittesting branch September 13, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASM Application Security Monitoring changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants