Skip to content

Add Python E2E coverage for instance ID prefix queries#3436

Draft
cgillum wants to merge 1 commit into
devfrom
e2e-python-instance-id-prefix-query
Draft

Add Python E2E coverage for instance ID prefix queries#3436
cgillum wants to merge 1 commit into
devfrom
e2e-python-instance-id-prefix-query

Conversation

@cgillum
Copy link
Copy Markdown
Member

@cgillum cgillum commented May 4, 2026

Summary

  • add a BasicPython E2E HTTP endpoint that queries orchestration instances by instanceIdPrefix
  • add a shared E2E test that starts matching and non-matching orchestration IDs, queries by prefix, and verifies only matching IDs are returned
  • remove durable-client parameter type annotations from the BasicPython E2E app so the current Python worker can index those functions

Validation

  • dotnet build test/e2e/Tests/E2ETests.csproj
  • targeted Python E2E against local azure-functions-durable-python SDK checkout: dotnet test test/e2e/Tests/E2ETests.csproj -f net8.0 --no-build --filter "FullyQualifiedName~Microsoft.Azure.Durable.Tests.DotnetIsolatedE2E.OrchestrationQueryTests.ListOrchestrations_ByInstanceIdPrefix_ShouldReturnOnlyMatchingInstances"

Blockers

This PR can't be merged until the corresponding Python SDK fix is merged: Azure/azure-functions-durable-python#604

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Python-focused E2E coverage for querying orchestrations by instanceIdPrefix, including a new BasicPython HTTP endpoint and a shared test that verifies only matching instance IDs are returned.

Changes:

  • Added an E2E test that starts matching/non-matching instance IDs and validates prefix-query results.
  • Added a BasicPython HTTP route to query instances by instanceIdPrefix.
  • Removed Python durable-client parameter type annotations to ensure the current Python worker can index the functions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/Tests/Tests/OrchestrationQueryTests.cs Adds an E2E test for querying instances by instanceIdPrefix (skipped for non-Python apps).
test/e2e/Apps/BasicPython/orchestration_query.py Adds GetInstancesByPrefix endpoint and updates JSON response handling.
test/e2e/Apps/BasicPython/timeout_orchestration.py Removes durable client type annotation for worker indexing compatibility.
test/e2e/Apps/BasicPython/terminate_orchestration.py Removes durable client type annotation for worker indexing compatibility.
test/e2e/Apps/BasicPython/suspend_resume_orchestration.py Removes durable client type annotations for worker indexing compatibility.
test/e2e/Apps/BasicPython/purge_orchestration_history.py Removes durable client type annotation for worker indexing compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +19 to +20
# This would not be necessary if we implemnted __str__ for
# DurableOrchestrationStatus using to_json under the hood
@bp.durable_client_input(client_name="client")
async def get_instances_by_prefix(req: func.HttpRequest, client):
try:
instance_id_prefix = req.params.get("instanceIdPrefix")
Comment on lines +56 to +61
except Exception as ex:
response = func.HttpResponse(
str(ex),
status_code=400,
mimetype="text/plain"
)
@@ -15,7 +15,7 @@

@bp.route(route="TimeoutOrchestrator_HttpStart", methods=["GET", "POST"])
@bp.durable_client_input(client_name="client")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants