Skip to content

Commit

Permalink
add UT for PFS invocation failed
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengfeiwang committed Apr 11, 2024
1 parent 05e135d commit 297072d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
TRACE_DEFAULT_COLLECTION,
ContextAttributeKey,
)
from promptflow._sdk._errors import PromptFlowServiceInvokeError
from promptflow._sdk._tracing import start_trace_with_devkit
from promptflow._sdk.operations._trace_operations import TraceOperations
from promptflow.client import PFClient
Expand Down Expand Up @@ -197,6 +198,13 @@ def test_setup_exporter_in_executor_with_preview_flag(
== f"http://localhost:{MOCK_PROMPTFLOW_SERVICE_PORT}/v1/traces"
)

def test_pfs_invocation_failed_in_start_trace(self):
with mock.patch("promptflow._sdk._tracing._invoke_pf_svc"), mock.patch(
"promptflow._sdk._tracing.is_pfs_service_healthy", return_value=False
):
with pytest.raises(PromptFlowServiceInvokeError):
start_trace_with_devkit(collection=str(uuid.uuid4()))


@pytest.mark.unittest
@pytest.mark.sdk_test
Expand Down

0 comments on commit 297072d

Please sign in to comment.