elsa-core/test/integration/Elsa.Workflows.IntegrationTests/Scenarios
Sipke Schoorstra aee09bb06f
Improves workflow deletion and task scheduling (#7088)
* Refactor workflow instance deletion to use `IWorkflowRuntime` for enhanced coordination and separation of concerns.

* Remove `EnumerableTypeConverter` and update related usages for serialization.

- Deleted the `EnumerableTypeConverter` class and its JSON serialization logic.
- Removed associated type descriptor attribute in `DefaultFormattersFeature`.
- Updated `ObjectFormatter` to handle collection serialization directly with JSON.

* Remove `EnumerableTypeConverter` tests and consolidate serialization logic into `ObjectFormatter`.

- Deleted `EnumerableTypeConverterTests` as the related functionality was removed.
- Added comprehensive tests in `ObjectFormatterTests` to handle serialization of collections and arrays with JSON.

* Add integration tests for `TriggerIndexer` to handle workflows with failing materialization

- Introduced comprehensive test scenarios verifying `DeleteTriggersAsync` behavior when workflows fail to load or partially succeed.
- Enhanced error handling in `TriggerIndexer` to skip failed workflows while ensuring remaining workflows are processed.

* Add exception handling in `TriggerIndexer.DeleteTriggersAsync` and integration tests

- Enhanced `DeleteTriggersAsync` with exception handling to skip failed workflows while processing others.
- Logged warnings for failed workflows without halting execution.
- Added comprehensive integration tests to verify behavior across success, failure, and mixed scenarios.
- Refactored tests for improved clarity, maintainability, and consistency.

* Add exception handling for `ResumeWorkflowTask` to skip deleted workflow instances

- Enhanced `ResumeWorkflowTask.ExecuteAsync` to handle `WorkflowInstanceNotFoundException` gracefully when a scheduled workflow instance is missing.
- Logged warnings for skipped executions to improve observability.
- Ensured remaining workflows and scheduled tasks are processed seamlessly without disruption.

* Add thread safety to `LocalScheduler` to prevent race conditions during concurrent scheduling

- Introduced a `lock` object to synchronize access to internal dictionaries.
- Resolved `IndexOutOfRangeException` caused by concurrent modifications during startup.
- Ensured thread-safe operations in `ScheduleAsync`, `ClearScheduleAsync`, and related methods.
- Improved reliability and stability of scheduling under concurrent workloads.

* Improve exception handling, thread safety, and workflow instance deletion

- Added exception handling in `TriggerIndexer.DeleteTriggersAsync` to skip failed workflows while continuing processing.
- Enhanced `ResumeWorkflowTask` to handle missing workflow instances gracefully and log warnings.
- Introduced thread synchronization in `LocalScheduler` with `lock` to prevent concurrent access issues.
- Implemented and refactored tests to ensure behavior consistency and improve maintainability.
- Added component tests for workflow deletion scenarios, covering running, completed, and non-existent workflows.

* Add component tests for workflow instance deletion and refactor bulk delete logic

- Added comprehensive component tests for workflow instance deletion scenarios (running, completed, bulk, and non-existent instances).
- Refactored `BulkDelete` API to use `IWorkflowInstanceManager` for proper cleanup of related records (execution logs, activity executions, bookmarks).

* Add integration tests and fakes for `TriggerIndexer` to verify behavior with failing and successful workflows

- Introduced `FailingMaterializer` and `WorkingMaterializer` for simulating failing and successful workflow materializations.
- Added `TriggerDeletionTestScenario`, `TriggerTestDataBuilder`, and related test data classes to define comprehensive test cases.
- Updated `DeleteTriggersAsync` tests with scenarios for materialization failures and mixed success.
- Improved test coverage and maintainability with reusable test data builders and utilities.
2025-11-21 20:58:38 +01:00
..
ActivityNotificationsMiddleware Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
ActivityOutputs Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
Blocking Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
BlockingAndBreaking Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
CanExecute Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
Composites Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
CompositesAndOutcomes Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
CompositesPassingData Add unit and integration tests for SetOutput activity 2025-10-22 23:43:51 +02:00
DependencyWorkflows Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
DependencyWorkflowsPublishing Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
ExplicitJoins Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
FlowchartCompletion Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
FlowchartNextActivity Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
HttpRequestWithLiquid Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
ImportAndExecute Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ImportAndPublish Create trigger payload validation, refacto HttpEndpoint validator and create Cron validator (#6641) 2025-05-20 19:52:43 +02:00
Incidents Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
JavaScriptFunctions Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JavaScriptListsAndArrays Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JavaScriptNativeVariables Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JoinBehaviors Add integration test for implicit join behavior with merge mode set to None 2025-10-08 21:10:35 +02:00
JsonObjectSerialization Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
JsonObjectToObjectRemainsJsonObject Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
ParentChildCompletion Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ParentChildInputs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ParentChildOutputMapping Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
RunAsynchronousActivityOutput Small refactor for DRY principle + Fixing integration tests 2025-08-06 11:31:36 +02:00
Serialization Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
SetGetVariables Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
SetGetVariablesArray Added IEnumerableTypeConverter (#7020) 2025-11-12 11:07:33 +01:00
SetGetVariablesFromActivities Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
TriggerIndexing Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
WorkflowCancellation Improved support for named workflow instances 2025-03-02 11:17:18 +01:00
WorkflowDefinitionActivities Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
WorkflowDefinitionStorePopulation Addresses workflow identity reload conflict (#6909) 2025-09-15 11:56:01 +02:00
WorkflowInstanceName Improved support for named workflow instances 2025-03-02 11:17:18 +01:00
WorkflowOutputMapping Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
WorkflowResults Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00