Skip to content
Merged
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
26 changes: 13 additions & 13 deletions tests/sentry/api/endpoints/test_organization_ai_conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test_complete_conversation_data_across_time_range(self) -> None:

def test_first_input_last_output(self) -> None:
"""Test firstInput and lastOutput are correctly populated from ai_client spans"""
now = before_now(days=90).replace(microsecond=0)
now = before_now(days=11).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -699,7 +699,7 @@ def test_first_input_last_output(self) -> None:

def test_no_ai_client_spans_filtered_out(self) -> None:
"""Test conversations without input/output are filtered out"""
now = before_now(days=91).replace(microsecond=0)
now = before_now(days=12).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -732,7 +732,7 @@ def test_no_ai_client_spans_filtered_out(self) -> None:

def test_query_filter(self) -> None:
"""Test that query parameter filters conversations"""
now = before_now(days=30).replace(microsecond=0)
now = before_now(days=25).replace(microsecond=0)
conversation_id_1 = uuid4().hex
conversation_id_2 = uuid4().hex

Expand Down Expand Up @@ -770,7 +770,7 @@ def test_query_filter(self) -> None:

def test_conversation_with_user_data(self) -> None:
"""Test that user data is extracted from spans and returned in the response"""
now = before_now(days=100).replace(microsecond=0)
now = before_now(days=13).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -822,7 +822,7 @@ def test_conversation_with_user_data(self) -> None:

def test_conversation_with_partial_user_data(self) -> None:
"""Test that user is returned even with partial user data"""
now = before_now(days=101).replace(microsecond=0)
now = before_now(days=14).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -857,7 +857,7 @@ def test_conversation_with_partial_user_data(self) -> None:

def test_new_format_input_output_messages(self) -> None:
"""Test that new format gen_ai.input.messages and gen_ai.output.messages are parsed correctly"""
now = before_now(days=102).replace(microsecond=0)
now = before_now(days=16).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -904,7 +904,7 @@ def test_new_format_input_output_messages(self) -> None:

def test_new_format_with_multiple_text_parts(self) -> None:
"""Test that multiple text parts are concatenated correctly"""
now = before_now(days=103).replace(microsecond=0)
now = before_now(days=17).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -955,7 +955,7 @@ def test_new_format_with_multiple_text_parts(self) -> None:

def test_new_format_priority_over_old_format(self) -> None:
"""Test that new format attributes take priority over old format when both exist"""
now = before_now(days=104).replace(microsecond=0)
now = before_now(days=18).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -1010,7 +1010,7 @@ def test_new_format_priority_over_old_format(self) -> None:

def test_new_format_parts_structure(self) -> None:
"""Test that new format with parts structure works correctly"""
now = before_now(days=105).replace(microsecond=0)
now = before_now(days=19).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -1055,7 +1055,7 @@ def test_new_format_parts_structure(self) -> None:

def test_tool_names_populated(self) -> None:
"""Test that toolNames is populated with distinct tool names from tool spans"""
now = before_now(days=106).replace(microsecond=0)
now = before_now(days=21).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -1128,7 +1128,7 @@ def test_tool_names_populated(self) -> None:

def test_tool_errors_counted(self) -> None:
"""Test that toolErrors counts only failed tool spans"""
now = before_now(days=107).replace(microsecond=0)
now = before_now(days=35).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -1212,7 +1212,7 @@ def test_tool_errors_counted(self) -> None:

def test_empty_tool_names_when_no_tool_calls(self) -> None:
"""Test that toolNames is empty when there are no tool calls"""
now = before_now(days=108).replace(microsecond=0)
now = before_now(days=23).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down Expand Up @@ -1257,7 +1257,7 @@ def test_tokens_only_counted_from_ai_client_spans(self) -> None:
This prevents double counting when both agent spans (invoke_agent) and their
child ai_client spans have token/cost data.
"""
now = before_now(days=109).replace(microsecond=0)
now = before_now(days=24).replace(microsecond=0)
conversation_id = uuid4().hex
trace_id = uuid4().hex

Expand Down
Loading