Skip to content

test(appsec): add coverage for BlockingSecurityEvent helpers#4504

Draft
ManuelPalenzuelaDD wants to merge 1 commit intomainfrom
codex/add-test-to-dd-trace-go
Draft

test(appsec): add coverage for BlockingSecurityEvent helpers#4504
ManuelPalenzuelaDD wants to merge 1 commit intomainfrom
codex/add-test-to-dd-trace-go

Conversation

@ManuelPalenzuelaDD
Copy link
Copy Markdown
Contributor

Motivation

  • Provide unit test coverage for the security error helpers to exercise branches in IsSecurityError and the BlockingSecurityEvent.Error() message.

Description

  • Add appsec/events/block_test.go with a test for BlockingSecurityEvent.Error() validating the returned string.
  • Add TestIsSecurityError with subtests covering nil, a direct BlockingSecurityEvent, a wrapped BlockingSecurityEvent using errors.Join, and a non-security error case.

Testing

  • Run go test ./appsec/events which completed successfully.

Codex Task

@ManuelPalenzuelaDD ManuelPalenzuelaDD requested a review from a team as a code owner March 6, 2026 10:27
@ManuelPalenzuelaDD ManuelPalenzuelaDD marked this pull request as draft March 6, 2026 10:27
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Mar 6, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 59.15% (-0.10%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cd1e6a0 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Mar 6, 2026

Benchmarks

Benchmark execution time: 2026-03-06 10:47:38

Comparing candidate commit cd1e6a0 in PR branch codex/add-test-to-dd-trace-go with baseline commit 89047df in branch main.

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants