Skip to content

[ruby@appsec-61515-add-content-headers-when-appsec-enabled] Enable tests for content-*#6454

Draft
Strech wants to merge 2 commits intomainfrom
appsec-61515-enable-content-length-tests
Draft

[ruby@appsec-61515-add-content-headers-when-appsec-enabled] Enable tests for content-*#6454
Strech wants to merge 2 commits intomainfrom
appsec-61515-enable-content-length-tests

Conversation

@Strech
Copy link
Member

@Strech Strech commented Mar 9, 2026

Motivation

Closing gap for content-length and content-type tests

Changes

Mostly in Tracer DataDog/dd-trace-rb#5423

end

use TraceSamplingMiddleware
use Rack::ContentLength
Copy link
Member Author

Choose a reason for hiding this comment

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

As a separate example, we will pre-compute here a Content-Length header, but rest of the weblogs don't do it as they rely on web-server to compute it

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

CODEOWNERS have been resolved as:

manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
utils/build/docker/ruby/rack/config.ru                                  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core

@Strech Strech force-pushed the appsec-61515-enable-content-length-tests branch from 1a0c550 to 4bfefee Compare March 9, 2026 10:48
@datadog-official
Copy link

datadog-official bot commented Mar 9, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 40 Tests failed

tests.ai_guard.test_ai_guard_sdk.Test_Evaluation.test_abort[rails52] from system_tests_suite (Datadog) (Fix with Cursor)
assert False

self = <tests.ai_guard.test_ai_guard_sdk.Test_Evaluation object at 0x7f7e304606b0>

    def test_abort(self):
        """Test ABORT action for tool call attempting to read /etc/passwd.
        Expects 403 when blocking enabled, 200 when disabled.
        Span should have action="ABORT" and target="tool" with tool_name.
        """
        for block, request in self.r.items():
...
tests.ai_guard.test_ai_guard_sdk.Test_Evaluation.test_abort[rails61] from system_tests_suite (Datadog) (Fix with Cursor)
assert False

self = <tests.ai_guard.test_ai_guard_sdk.Test_Evaluation object at 0x7f5130b8fa10>

    def test_abort(self):
        """Test ABORT action for tool call attempting to read /etc/passwd.
        Expects 403 when blocking enabled, 200 when disabled.
        Span should have action="ABORT" and target="tool" with tool_name.
        """
        for block, request in self.r.items():
...
tests.ai_guard.test_ai_guard_sdk.Test_Evaluation.test_deny[rails52] from system_tests_suite (Datadog) (Fix with Cursor)
assert False

self = <tests.ai_guard.test_ai_guard_sdk.Test_Evaluation object at 0x7f7e30460590>

    def test_deny(self):
        """Test DENY action for destructive disk wipe command.
        Expects 403 when blocking enabled, 200 when disabled.
        Span should have action="DENY" and error flag should be set when blocking.
        """
        for block, request in self.r.items():
...
View all

ℹ️ Info

❄️ No new flaky tests detected

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

@Strech Strech force-pushed the appsec-61515-enable-content-length-tests branch from a44a8eb to 9972c6f Compare March 10, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant