mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
tests: adding missing cassettes
This commit is contained in:
221
tests/cassettes/test_telemetry_fails_due_connect_timeout.yaml
Normal file
221
tests/cassettes/test_telemetry_fails_due_connect_timeout.yaml
Normal file
File diff suppressed because one or more lines are too long
@@ -42,24 +42,25 @@ from opentelemetry import trace
|
|||||||
"opentelemetry.exporter.otlp.proto.http.trace_exporter.OTLPSpanExporter.export",
|
"opentelemetry.exporter.otlp.proto.http.trace_exporter.OTLPSpanExporter.export",
|
||||||
side_effect=Exception("Test exception"),
|
side_effect=Exception("Test exception"),
|
||||||
)
|
)
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_telemetry_fails_due_connect_timeout(export_mock, logger_mock):
|
def test_telemetry_fails_due_connect_timeout(export_mock, logger_mock):
|
||||||
error = Exception("Test exception")
|
error = Exception("Test exception")
|
||||||
export_mock.side_effect = error
|
export_mock.side_effect = error
|
||||||
|
|
||||||
tracer = trace.get_tracer(__name__)
|
tracer = trace.get_tracer(__name__)
|
||||||
with tracer.start_as_current_span("test-span"):
|
with tracer.start_as_current_span("test-span"):
|
||||||
base_agent = Agent(
|
agent = Agent(
|
||||||
role="base_agent",
|
role="agent",
|
||||||
llm="gpt-4o-mini",
|
llm="gpt-4o-mini",
|
||||||
goal="Just say hi",
|
goal="Just say hi",
|
||||||
backstory="You are a helpful assistant that just says hi",
|
backstory="You are a helpful assistant that just says hi",
|
||||||
)
|
)
|
||||||
base_task = Task(
|
task = Task(
|
||||||
description="Just say hi",
|
description="Just say hi",
|
||||||
expected_output="hi",
|
expected_output="hi",
|
||||||
agent=base_agent,
|
agent=agent,
|
||||||
)
|
)
|
||||||
crew = Crew(agents=[base_agent], tasks=[base_task], name="TestCrew")
|
crew = Crew(agents=[agent], tasks=[task], name="TestCrew")
|
||||||
crew.kickoff()
|
crew.kickoff()
|
||||||
|
|
||||||
trace.get_tracer_provider().force_flush()
|
trace.get_tracer_provider().force_flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user