Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss committed Jun 7, 2024
1 parent d01b9b5 commit b5f7825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def exporter():
@pytest.fixture(autouse=True)
def environment():
os.environ["OPENAI_API_KEY"] = "test_api_key"
os.environ["TRACELOOP_TRACE_CONTENT"] = "true"


@pytest.fixture(autouse=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from haystack.components.builders import DynamicChatPromptBuilder
from haystack.dataclasses import ChatMessage
from haystack.utils import Secret
from opentelemetry.semconv.ai import SpanAttributes


@pytest.mark.vcr
Expand Down Expand Up @@ -34,3 +35,6 @@ def test_haystack(exporter):
"haystack.openai.chat",
"haystack_pipeline.workflow",
} == {span.name for span in spans}
span_workflow = next(span for span in spans if span.name == "haystack_pipeline.workflow")
assert SpanAttributes.TRACELOOP_ENTITY_INPUT in span_workflow.attributes
assert SpanAttributes.TRACELOOP_ENTITY_OUTPUT in span_workflow.attributes

0 comments on commit b5f7825

Please sign in to comment.