Add Python E2E coverage for instance ID prefix queries#3436
Draft
cgillum wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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") | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
instanceIdPrefixValidation
dotnet build test/e2e/Tests/E2ETests.csprojdotnet 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