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

[python] Enable more user event tests #3935

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manifests/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ tests/:
Test_V3_Login_Events_RC: v2.11.0
test_automated_user_and_session_tracking.py:
Test_Automated_Session_Blocking: missing_feature
Test_Automated_User_Blocking: missing_feature
Test_Automated_User_Tracking: missing_feature
Test_Automated_User_Blocking: v2.21.0.dev
Test_Automated_User_Tracking: v2.21.0.dev
test_blocking_addresses.py:
Test_BlockingGraphqlResolvers: missing_feature
Test_Blocking_client_ip:
Expand Down
9 changes: 9 additions & 0 deletions tests/appsec/test_automated_user_and_session_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from utils import context
from utils import features
from utils import interfaces
from utils import irrelevant
from utils import remote_config as rc
from utils import rfc
from utils import scenarios
Expand Down Expand Up @@ -51,6 +52,10 @@ def setup_user_tracking_auto(self):
cookies=self.r_login.cookies,
)

@irrelevant(
context.library == "python" and context.weblog_variant not in ["django-poc", "python3.12", "django-py3.13"],
reason="no possible auto-instrumentation for python except on Django",
)
def test_user_tracking_auto(self):
assert self.r_login.status_code == 200

Expand Down Expand Up @@ -161,6 +166,10 @@ def setup_user_blocking_auto(self):
cookies=self.r_login.cookies,
)

@irrelevant(
context.library == "python" and context.weblog_variant not in ["django-poc", "python3.12", "django-py3.13"],
reason="no possible auto-instrumentation for python except on Django",
)
def test_user_blocking_auto(self):
assert self.config_state_1[rc.RC_STATE] == rc.ApplyState.ACKNOWLEDGED
assert self.r_login.status_code == 200
Expand Down
2 changes: 2 additions & 0 deletions utils/build/docker/python/django/django_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@
},
"root": {"handlers": ["console"], "level": "ERROR"},
}

SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
2 changes: 1 addition & 1 deletion utils/scripts/load-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ elif [ "$TARGET" = "dotnet" ]; then
elif [ "$TARGET" = "python" ]; then
assert_version_is_dev

TARGET_BRANCH="${TARGET_BRANCH:-main}"
TARGET_BRANCH="${TARGET_BRANCH:-3.x-staging}"
echo "git+https://github.com/DataDog/dd-trace-py.git@$TARGET_BRANCH" > python-load-from-pip
echo "Using $(cat python-load-from-pip)"

Expand Down