Skip to content

SDK-Testing#11

Merged
Farahtharwat35 merged 33 commits into
mainfrom
SDK-testing
Jun 19, 2025
Merged

SDK-Testing#11
Farahtharwat35 merged 33 commits into
mainfrom
SDK-testing

Conversation

@Farahtharwat35

@Farahtharwat35 Farahtharwat35 commented Jun 16, 2025

Copy link
Copy Markdown
Owner

Changes

Testing Scenarios Overview

TestApp (test_app.py)

  1. Service Discovery
  • Validates /discover endpoint response format
  • Ensures correct workflow metadata exposure (name, input/output types, retention)

2- Router Registration

  • Verifies workflow endpoints are properly registered
  • Tests execution through HTTP endpoints

3- Error Handling

  • Tests EndureException conversion to HTTP responses
  • Validates error response format and status codes

4- Multiple Services

  • Tests registration of multiple services
  • Verifies multiple workflows within same service
  • Ensures proper segregation between services

TestService (test_service.py)

1- Workflow Decorator

  • Valid function signatures validation
  • Default retention period assignment
  • Invalid retention period handling

2- Parameter Validation

  • Missing context parameter detection
  • Wrong context type validation
  • Input parameter requirements

3- Multiple Registration

  • Multiple workflows in same service
  • Function preservation after decoration

TestWorkflow (test_workflow.py)

1-Type System

  • Basic types (int, str, dict)
  • Generic containers (list, dict)
  • Union and Optional types
  • Complex nested classes
  • Default value handling

2-Handler Routes

  • Synchronous workflow execution
  • Asynchronous workflow execution
  • Input validation
  • Error condition handling

3-Type Description

  • Nested type representation
  • Class type extraction
  • Default value preservation
  • Complex type formatting

TestInternalClient (test_internal_client.py)

1-Log Operations

  • Successful log sending
  • Log format validation
  • Response handling

2-Configuration

  • Environment variable validation
  • Base URL configuration
  • Invalid configuration handling

3-Error Scenarios

  • Invalid input parameters
  • HTTP error handling
  • Missing configuration errors

TestWorkflowContext (test_workflow_context.py)

1-Action Execution

  • Successful execution flow
  • State logging validation
  • Result handling

2-Retry Mechanism

  • Retry timing respect
  • Maximum retry enforcement
  • Backoff strategy application

3-Idempotency

  • Already executed action handling
  • Result caching
  • State consistency

4-Error Handling

  • HTTP exception handling
  • Retry exhaustion
  • Error state logging

TestServiceRegistry (test_service_registry.py)

1-Registration

  • Workflow registration
  • Service management
  • Router successfully created
  • Duplicate workflow name prevention within same service

2-Service Listing

  • Proper service listing

Checks

  • unit testing
  • documentation
  • build check
  • code format and docstring

Comment thread src/app/service.py
Comment thread src/app/_internal/__init__.py Outdated
Comment thread src/app/workflow_context.py
@SalmaElsoly SalmaElsoly requested a review from Copilot June 19, 2025 18:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements comprehensive changes to the SDK’s testing suite, workflow execution logic, internal client, service registry and overall application integration. Key updates include:

  • Overhauling the workflow execution and retry logic in WorkflowContext and internal workflow modules.
  • Revising the Service and ServiceRegistry APIs including parameter validation and endpoint route registration.
  • Updating test suites, configurations and project files for consistency and enhanced error handling.

Reviewed Changes

Copilot reviewed 28 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/* New and updated tests cover diverse execution, error, and retry scenarios.
src/app/workflow_context.py Enhanced execution logic, retry handling, and updated docs.
src/app/service.py Improved workflow decorator with stricter input signature validation.
src/app/_internal/* Revised internal client and registry implementations.
src/app/app.py Updated DurableApp with extended service discovery and error handling.
Other config files (pyproject.toml, Makefile, etc.) Minor adjustments to build, testing, and linting configurations.

Comment thread src/app/service.py Outdated
Comment thread src/app/workflow_context.py Outdated
Comment thread src/app/_internal/internal_client.py Outdated
@SalmaElsoly SalmaElsoly self-requested a review June 19, 2025 21:03
@Farahtharwat35 Farahtharwat35 merged commit aec884a into main Jun 19, 2025
4 checks passed
@Farahtharwat35 Farahtharwat35 deleted the SDK-testing branch June 30, 2025 20:07
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.

3 participants