Repository navigation
fix(testing): match service for error size check and history redaction #824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
nvasiu marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -616,7 +616,7 @@ def from_start_durable_execution_input( | |
| start_durable_execution_input: StartDurableExecutionInput, | ||
| include: bool = False, # noqa: FBT001, FBT002 | ||
| ) -> EventInput: | ||
| input: str | None = start_durable_execution_input.input | ||
| input: str | None = start_durable_execution_input.input if include else None | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The latest revision changes EventInput.from_start_durable_execution_input(), but no repository code or test calls this method. So all tests still pass if someone removes the new if include else None branch. CONTRIBUTING rule 4 requires each new branch to have a test that fails without it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a test for this. |
||
| truncated: bool = not include | ||
| return cls(input, truncated) | ||
|
|
||
|
|
@@ -658,8 +658,11 @@ def from_durable_execution_invocation_output( | |
| durable_execution_invocation_output: DurableExecutionInvocationOutput, | ||
| include: bool = False, # noqa: FBT001, FBT002 | ||
| ) -> EventResult: | ||
| payload: str | None = ( | ||
| durable_execution_invocation_output.result if include else None | ||
| ) | ||
| truncated: bool = not include | ||
| return cls(durable_execution_invocation_output.result, truncated) | ||
| return cls(payload, truncated) | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
|
|
@@ -693,17 +696,21 @@ def from_details( | |
| include: bool = False, # noqa: FBT001, FBT002 | ||
| ) -> EventError: | ||
| error_object: ErrorObject | None = details.error if details else None | ||
| payload: ErrorObject | None = error_object if include else None | ||
| truncated: bool = not include | ||
| return cls(error_object, truncated) | ||
| return cls(payload, truncated) | ||
|
|
||
| @classmethod | ||
| def from_durable_execution_invocation_output( | ||
| cls, | ||
| durable_execution_invocation_output: DurableExecutionInvocationOutput, | ||
| include: bool = False, # noqa: FBT001, FBT002 | ||
| ) -> EventError: | ||
| payload: ErrorObject | None = ( | ||
| durable_execution_invocation_output.error if include else None | ||
| ) | ||
| truncated: bool = not include | ||
| return cls(durable_execution_invocation_output.error, truncated) | ||
| return cls(payload, truncated) | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
|
|
@@ -1800,7 +1807,11 @@ def create_context_event_succeeded(cls, context: EventCreationContext) -> Event: | |
| def create_context_event_failed(cls, context: EventCreationContext) -> Event: | ||
| context_details: ContextDetails | None = context.operation.context_details | ||
| event_error: EventError | None = ( | ||
| EventError.from_details(context_details) if context_details else None | ||
| EventError.from_details( | ||
| context_details, include=context.include_execution_data | ||
| ) | ||
| if context_details | ||
| else None | ||
| ) | ||
| return cls( | ||
| event_type=EventType.CONTEXT_FAILED.value, | ||
|
|
@@ -2232,7 +2243,11 @@ def create_callback_event_succeeded(cls, context: EventCreationContext) -> Event | |
| def create_callback_event_failed(cls, context: EventCreationContext) -> Event: | ||
| callback_details: CallbackDetails | None = context.operation.callback_details | ||
| event_error: EventError | None = ( | ||
| EventError.from_details(callback_details) if callback_details else None | ||
| EventError.from_details( | ||
| callback_details, include=context.include_execution_data | ||
| ) | ||
| if callback_details | ||
| else None | ||
| ) | ||
| return cls( | ||
| event_type=EventType.CALLBACK_FAILED.value, | ||
|
|
@@ -2249,7 +2264,11 @@ def create_callback_event_failed(cls, context: EventCreationContext) -> Event: | |
| def create_callback_event_timed_out(cls, context: EventCreationContext) -> Event: | ||
| callback_details: CallbackDetails | None = context.operation.callback_details | ||
| event_error: EventError | None = ( | ||
| EventError.from_details(callback_details) if callback_details else None | ||
| EventError.from_details( | ||
| callback_details, include=context.include_execution_data | ||
| ) | ||
| if callback_details | ||
| else None | ||
| ) | ||
| return cls( | ||
| event_type=EventType.CALLBACK_TIMED_OUT.value, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.