* Add reloading logic for workflow definitions
Introduced a new mechanism to handle reloaded workflow definitions. This includes creating a "ReloadedWorkflowDefinition" model, updating the caching logic, and modifying notification handlers to work with the enhanced workflow reloading logic. This ensures workflow definitions are updated and managed correctly when published, retracted, or deleted.
* Improve RefreshActivityRegistry documentation
Updated the XML documentation to clarify that `RefreshActivityRegistry` refreshes the `IActivityRegistry` for `WorkflowDefinitionActivityProvider` whenever workflow definitions are reloaded, instead of when they are published, retracted, or deleted.
* Add 'materializer' to user dictionary
The term 'materializer' has been added to the user dictionary to improve code spelling and naming consistency. This change ensures that 'materializer' is recognized as a correct term in the codebase.
* Organize test files by adding a 'Workflows' directory
Renamed 'http-workflow.json' to indicate it belongs under 'Workflows'. This improves file organization and clarity within the 'WorkflowDefinitionReload' scenario.
* Add TestWorkflowMaterializer and TestWorkflowProvider
Introduce `TestWorkflowMaterializer` for deserializing workflows from `TestWorkflowProvider`. Added integration of these new components in the `ReloadWorkflowTests` and `WorkflowServer`. Also renamed `RemoveReloadWorkflowTests` to `ReloadWorkflowTests`.
* Rename and expand workflow reload tests
Renamed `RemoveReloadWorkflowTests` to `ReloadWorkflowTests` to better reflect its purpose and expanded with additional test cases. Added tests to verify workflow and activity registry updates after source provider changes and workflow reloads.
* Update copy settings for workflow test scenarios
Reorganized and added 'CopyToOutputDirectory' settings for JSON files in workflow test scenarios. Ensured all necessary files are correctly included and copied during output directory builds to maintain test consistency.
* Refactor workflow definition events handling and dispatch
Removed IDistributedWorkflowDefinitionEventsDispatcher interface and related classes in favor of direct message publishing through MassTransit. Introduced new workflow definition refresh endpoints and services for better modularity and responsiveness. Adjusted caching and notification systems to support the new architecture.
* Add comment
* Added workflow definition refresh component test
* Fixed component tests issue
* Fixed id
* Fixed test
* Rename IsRaisedFromConsumer to IsConsumerExecutionContext
Updated the naming for clarity and consistency across the system. This change affects AmbientConsumerScope, related consumers, and condition checks to improve readability and understanding of the consumer context.
---------
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* Refactor activity serialization process
Refactored the activity serialization process in Elsa workflow API. The changes include addition, modification and deletion of code blocks across various files to accommodate the restructuring. The changes focus primarily on the handling of composite root activities and their serialization. The utility of configuration options for serializer is also implemented.
* Stash
* Add IgnoreChildActivitiesConverter and improve activity JSON conversion
A new JSON converter, IgnoreChildActivitiesConverter, has been introduced to handle specific serialization scenarios. On top of this, improvements have been made to the existing ActivityJsonConverter. This includes more robust handling of synthetic properties and the ability to ignore child activities during serialization. In DiagramDesignerWrapper, an addition has been made to facilitate the handling of embedded activities.
* "Implement activity port tracking in workflow system"
Modified several components of the workflow system to include activity port tracking for better visibility and control over workflow structures. In addition, unnecessary files were deleted, new ones were introduced, and changes were made to existing files to incorporate the new functionality. Notably, IActivityResolver interface now includes GetActivityPortsAsync method to allow retrieving activity ports. This enhances the ability to track actions in complex workflows.
* Add specialized converter check in activity serialization
The commit introduces a check for specialized JSON converters in two serialization methods inside `ActivityJsonConverter.cs` and `ActivityNodeConverter.cs`. If a specialized converter exists for a particular activity type, the serializer now uses it to serialize the activity, enhancing the serialization process's flexibility.
* Ignore serialization of ConfigureSerializerOptions
Added JsonIgnore attribute to the ConfigureSerializerOptions in the ActivityDescriptor class. This will prevent it from being included during the JSON serialization process, ensuring that it is not unnecessarily processed or exposed in serialized data formats.
* Refactor method to find WorkflowDefinition instead of WorkflowGraph
The method FindWorkflowGraphAsync was revised to find WorkflowDefinition rather than WorkflowGraph, reflecting its new purpose in the code. This change has also affected the related variables and logic where this function was called. The rationale for this revision is that the WorkflowGraph is a dynamic entity that should be computed at runtime, and hence cannot be reliably retrieved for static inspection.
* Update API endpoint and simplify request handling in workflow
The API endpoint for fetching workflow definitions graph has been changed from "/workflow-definitions/{definitionId}/graph" to "/workflow-definitions/subgraph/{id}". Similarly, the request handling has been simplified by removing version options and directly passing "Id" to the "FindWorkflowGraphAsync" method.
* Update import statements and remove unused dependencies
Some import/using statements have been adjusted to remove the 'Contracts' suffix in contexts where it's not necessary. A few unused dependencies have also been removed. These changes clean up the code and ensure proper functionality in the Elsa workflows system.
* Update .editorconfig settings
The .editorconfig settings have been revised to enforce inheritance of settings from higher directories. Additionally, the parameter 'file_header_template' has been removed. This update optimizes the configuration settings for better coding standards across C# files.
* Remove App_Data folder from Elsa.Server.Web.csproj
The App_Data folder reference has been removed from the Elsa.Server.Web project file. This change is included as the folder no longer seems necessary for the operation of the project.
* Remove unused namespace in ServiceProviderExtensions.cs
The Elsa.Workflows.Runtime.Options namespace, previously imported in the ServiceProviderExtensions file within the Elsa.Testing.Shared project, has been removed as it is not utilized. This cleanup enhances readability and maintains cleaner code.
* Implement GetActivityPortsAsync method in various classes
Added the implementation of GetActivityPortsAsync method in WorkplaceDefinitionActivityPortResolver, SendHttpRequestActivityPortResolver, OutboundActivityPortResolver, and SwitchActivityPortResolver classes. Changes also include adding inheritdoc comments for these methods, making GetActivityPortsInternal method private and static, and removing unneeded white spaces.
* Remove GetActivitiesAsync method from activity resolvers
The GetActivitiesAsync method has been removed from various activity resolver classes including WorkflowDefinitionActivityPortResolver, SendHttpRequestActivityPortResolver, OutboundActivityPortResolver, and SwitchActivityPortResolver. The corresponding interface IActivityResolver has also been updated to reflect this change. This simplifies the structure by focusing only on the activity ports.
* Simplify workflow definition serialization
Removed the cloning of serializer options and the exclusion of composite activities from being serialized in the workflow definition model. This simplification results in cleaner code with less redundancy and unnecessary operations.
* Refactor workflow definition endpoints, optimize response handling
Major refactor of workflow definition endpoints in the Elsa.Workflows.Api module. Unnecessary serialization processes have been removed. Response handling was also streamlined to use the SendOkAsync method, optimizing resource usage and increasing application performance. Commit also includes removal of some unused namespaces.
* Remove IncludeCompositeRoot property from Models
The IncludeCompositeRoot property has been removed from the Models in the GetByDefinitionId, GetById, and GetManyById endpoints. These changes simplify the code as the property was commented out and not used in current workflow logic.
* Simplify workflow definition publishing process
This commit simplifies the workflow definition publishing process in the Elsa.Workflows.Api module. The code associated with checking if a workflow definition is already published and publishing it if not has been reduced for increased readability and maintainability.
* Refactor code in workflow publish endpoint
Removed unused import for better code clarity and simplified variable declaration for publishing result. The refactoring is carried out to improve code readability and maintainability in the workflow definition publishing endpoint.
* Refactor ActivityPort in Elsa.Workflows module
This commit simplifies the code in the ActivityPort class, part of the Elsa.Workflows module. It includes a significant rework of the comments for better clarity and understanding. Effort has been made to make the code more readable and easier to maintain in this refactor.
* Refactor serialization methods and improve Synthetic Properties handling
This commit refactors the activity serialization methods and improves the handling of synthetic properties. The changes remove the IgnoreChildActivitiesConverter and move synthetic property writing to a separate helper class, SyntheticPropertiesWriter. Various refinements have been made to different converter classes to better handle activity serialization. Furthermore, a function's name was improved from "FindWorkflowGraphAsync" to "GetWorkflowDefinitionAsync" to more accurately reflects its purpose.
* Add ActivityWriter to help serialize workflow activities
This commit introduces a new class ActivityWriter, that handles the serialization of workflow activities to JSON. Other classes such as ActivityNodeConverter and ActivityJsonConverter have been refactored to utilize this new helper. The codebase is now more DRY, avoids duplicate code and increases code maintainability.
* Refactor Json serialization for ignoring specialized converters
Removed 'IActivityRegistry' from 'JsonIgnoreCompositeRootConverter'. Instead, added an 'ignoreSpecializedConverters' argument to the 'WriteActivity' method in 'ActivityWriter'. This adjustment facilitates managing specialized converter behavior more efficiently during JSON serialization.
* Update ActivityNode serialization description
The comments for the ActivityNodeConverter class have been modified to clarify the serialization process. It now explicitly states that it includes descendant nodes based on the specified depth rather than just immediate child nodes. The parameter 'depth' description has been updated to 'the number of levels of descendants to include'.
* Refine workflow serializer and update activity writer parameters
The WorkflowSerializer clone operation has been simplified to directly call GetOptions from the API Serializer. Furthermore, an unnecessary comment was removed. In the ActivityWriter, an additional parameter was introduced for controlling whether to ignore the availability of converters that can handle IActivity objects. A superfluous front slash was removed from the class description comment.
* Add WorkflowJsonStructureTests and related JSON files
This commit introduces the WorkflowJsonStructureTests class which includes tests for the structure of the workflow definition in JSON format. In addition, main.json and sub.json files, containing mock data for testing, were added to the `WorkflowJsonStructures` scenario within the Elsa Workflows Component Tests. Updates to the project file ensure these new files are included correctly.
* Update WorkflowJsonStructureTests with subgraph test
This commit introduces a new test case named 'Requesting_Subgraph_Returns_ExpectedSubgraph' in the WorkflowJsonStructureTests file. It also refactors 'Workflow_ContainingWorkflowActivity_ShouldNotIncludeChildrenOfWorkflowActivity' test to make use of constants for IDs. These changes increase the coverage and maintainability of the code.
* Update max line length in .editorconfig
This commit increases the max line length to 420 characters in the .editorconfig. Additionally, it removes the redundant 'resharper_csharp_max_line_length' setting.
* Replace ActivityNodeConverter with RootActivityNodeConverter
The commit involves a change in serialization strategy for ActivityNode in the Elsa Workflows modules. The ActivityNodeConverter has been replaced with a RootActivityNodeConverter, which changes the approach from serializing the ActivityNode type and its descendants based on specified depth to serializing the ActivityNode type without its children, with activity children now serialized as properties. Corresponding alterations have also been made in the test cases.
* Remove IActivityRegistry parameter from classes
The IActivityRegistry parameter was removed from WorkflowDefinitionActivityProvider and JsonIgnoreCompositeRootConverterFactory classes, simplifying their constructors. This change also affected Elsa.Workflows.ComponentTests where the node access through "root" was adjusted for these updates.
* Refactor variable handling in ExpressionExecutionContextExtensions
The core change in this commit is the refactoring of the handling of variables within the ExpressionExecutionContextExtensions. The methods GetVariable, CreateVariable, and GetVariableBlock have been altered for clarity and simplified reducing redundant code. Unnecessary parameters and returns in method documentation have been removed, and overall code formatting has been improved to enhance readability.
* Simplify MemoryRegister creation in Workflow.cs
The creation of the MemoryRegister object in the file Workflow.cs was simplified to one line. The previous method, which declared a new object then called the Declare method before returning, was removed.
* Map controller routes in server web program
Added a line of code in the Elsa.Server.Web program.cs file to map controller routes. This change ensures that HTTP requests are correctly directed to their corresponding controller actions.
* Update workflow state extraction logic
The logic in the WorkflowStateExtractor has been updated to retain the root Workflow activity context even if it's completed. This change is necessary to keep workflow-level variables accessible.
* Remove RequiresUnreferencedCode attribute from ConvertTo method
The RequiresUnreferencedCode attribute was removed from the ConvertTo method in the ObjectConverter class.
* Remove unused services and rename test file
Unused services in the AutoUpdateTests.cs class were removed, reducing clutter and improving code readability. Additionally, the DeleteWorkflow_Clustered.cs test file has been renamed to DeleteWorkflowClustered.cs for better naming consistency.
* Add CountdownStep activity and CountdownWorkflow for testing
This commit introduces new component tests for simulations involving counters. It includes a new CountdownStep activity that decrements a counter variable, as well as a CountdownWorkflow which consists of a loop based on the aforementioned activity. It also involves a CountdownWorkflowTests class for testing counter persistence across workflow runs.
* Remove unnecessary whitespace in CountdownWorkflowTests
This commit eliminates the superfluous whitespace in the CountdownWorkflowTests.cs file. It maintains the proper formatting and ensures code consistency across the test component.
* Refactor CountdownWorkflowTests constructor
Simplified the constructor of the CountdownWorkflowTests class. The changes remove the unnecessary constructor body and pass the 'app' object directly to the base AppComponentTest class, enhancing the code's readability and maintainability.
* Add application roles and configure them in MassTransit
A new enum ApplicationRole has been added for distinguishing among different roles (Hybrid, Api, Worker) an application can take. In the configuration of MassTransit, it is now possible to disable the consumers based on application role, which can help optimize the usage of resources and increase application efficiency.
* Update Program.cs
Switch to Memory broker
* Update Program.cs
Simplify DisableConsumers assignment.
* Update ApplicationRole.cs
Rename Hybrid to Default.
* Update appsettings.json
The timeouts for the WaitAsync methods in the ISignalManager interface have been increased. The new default value for these methods is now 2000 milliseconds, up from the previous 1000 milliseconds. This change will allow for more leniency in timing for workflow tests.
* Implemented global readonly and workflow readonly
* Fixed bug of unfilled versions
* Fixed failing test
* Updated pipeline
* Revert
* Pushed fixes based on the PR comments and fixed history bug
* Implemented changes based on PR comments
* Fixed issue in caused by AuthorizationHandler not being able to receive null resources
* Remove unused Google.Protobuf dependency in Program.cs
An unused Protobuf library import was found in Program.cs file. In order to clean up the code and improve readability, this import statement has been removed. No other changes have been made.
* Refactor code to reduce redundancy and improve readability
Optimize code by removing unnecessary constructor assignments and simplify function calls. The simplification is mainly achieved by directly passing the required services as constructor parameters instead of assigning them to private fields first. This results in a more readable and less redundant code.
---------
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* Add distributed locking to MassTransitWorkflowDispatcher
This commit introduces a distributed lock to the MassTransitWorkflowDispatcher to prevent concurrent updates to the workflow instance. The lock is acquired before any interaction with the workflow instance and is released after the update operation is complete.
* Refactor MassTransitWorkflowDispatcher for simplified code
Removed unnecessary code in the MassTransitWorkflowDispatcher.cs class, previously used to handle input and properties. Refactored to directly include input and properties in the DispatchWorkflowInstanceRequest object, increasing efficiency and readability.
* Remove unused IDistributedLockProvider dependency
The IDistributedLockProvider dependency in the constructor of MassTransitWorkflowDispatcher class was removed because it was identified as unnecessary in this context. This results in less complicated code and improved maintainability.
* Add bulk dispatch workflows unit tests
Added a new file `BulkDispatchWorkflowsTests.cs` that contains tests for Bulk Dispatch Workflows. Also, two new workflow files `EmployeeGreetingWorkflow.cs` and `GreetEmployeesWorkflow.cs` were added to define workflows used in the unit tests. This will help ensure the Bulk Dispatch Workflows feature is working as expected.
* Update property retrieval in FlowJoin activity
This commit modifies the way flowScope is retrieved within the FlowJoin activity in Elsa.Workflows.Core. Instead of directly calling GetProperty, a fallback value is now being provided in case the desired property is not found. This reduces the risk of null reference exceptions.
* Add FlowJoins component tests
Two new files have been created to facilitate component testing for the FlowJoins scenarios in the Elsa Workflows. The `Tests.cs` file includes a Fact to validate the successful execution of a Flowchart with a single FlowJoin. The `Workflows.cs` file defines a single join workflow for these tests.
* Add RabbitMq support to ComponentTests
Added RabbitMq to Infrastructure.cs for component testing, allowing both RabbitMqContainer and DbContainer to start and stop asynchronously. Also, adjusted WorkflowServer.cs to configure RabbitMq mass transit alongside existing PostgreSql support, aiming to improve testing robustness and coverage.
* Refactor placement of RemoveOrphanedSubscriptions service
Move the implementation of AddNotificationHandler<RemoveOrphanedSubscriptions>() from the notifier block to the singleton section in AzureServiceBusFeature.cs. This will help keep all service registration related to notifications in one place.
* Increase prefetch count
* Refactor hash method in Hasher.cs
The Hash method in the Hasher.cs file has been refactored to use more efficient code. Instead of creating a SHA256 instance, it directly hashes the data using SHA256.HashData. As a result, the private Hash method and its usage, which only has relevance to the previous approach, have been removed.
* Replace GetHashCode with SHA256 for script caching
Two unused namespaces, Esprima and Esprima.Ast, have been removed, and two new ones, System.Security.Cryptography and System.Text, have been added. These changes in Elsa.JavaScript's JintJavaScriptEvaluator file were made to replace the basic GetHashCode method, which was used earlier to generate a cache key for JavaScript scripts, with SHA256 hash function to ensure uniqueness and avoid possible hash collisions. This greatly increases the reliability of the caching mechanism.
* Set HTTP client timeout in WorkflowServer
The client timeout in WorkflowServer has been set to 1 minute for `ResrService` and `client` methods. This was done to manage long running requests and prevent timeouts.
* Refactor code and add validation in ScheduleActivityAsync methods
An unnecessary line of code in the ScheduleActivityAsync method under the ActivityExecutionContext file has been removed to simplify the function. Meanwhile, validation has been added to ensure that specified activities are part of the workflow. This improves code clarity and prevents potential errors caused by incorrect activity scheduling.
* Refactor ActivityVisitor to use ActivityVisitorContext
The ActivityVisitor class in Elsa.Workflows.Core was refactored to use an ActivityVisitorContext class. The introduction of this context class replaced the multiple hashsets that were used within function signatures, consolidating them into a single object and reducing function complexity. This change improves readability and code organization.
* Refactor WorkflowDefinitionActivity to use WorkflowGraph
Adjusted the WorkflowDefinitionActivity class in the Elsa.Workflows.Management module. The changes include migration from using Workflow to WorkflowGraph objects and condensing code blocks for clearer readability. Additionally, a new 'IsInitialized' field is added to eliminate potential race conditions during the graph construction process.
* Add activity validation to WorkflowExecutionContext
A check has been implemented in the WorkflowExecutionContextExtensions to validate that a specified activity is part of the workflow. This prevents incorrect activity references when scheduling tasks in the workflow.
* Refactor to use WorkflowGraph instead of Workflow
The codebase has been refactored to utilize the WorkflowGraph instead of the Workflow while running and manipulating workflows. Additional changes include restructuring WorkflowRunner and WorkflowDefinitionService classes, introducing WorkflowGraphBuilder usage, and mapping updates in WorkflowDefinitionMapper. The WorkflowHost, WorkflowDispatcher, and WorkflowExecutionContext have also been updated accordingly.
* Add WorkflowGraph and related services
This commit introduces the IWorkflowGraphBuilder interface, the WorkflowGraph model, and an implementation of the interface in the WorkflowGraphBuilder class. The purpose of these additions is to establish the building and structure of a workflow graph. The WorkflowGraph model also includes activity node handling and hashing capabilities.
* Add tests to ensure exception when scheduling an activity not part of workflow
Several unit tests were written to ensure that the right behavior is exhibited when scheduling an activity that is not part of the workflow. An exception is expected to be thrown in this case. Additionally, new service definitions, workflow definitions and workflow queries were added for more comprehensive testing.
* Update WorkflowGraph class and add comment descriptions
This commit updates the WorkflowGraph class by extending its descriptions and implementing an explicit mention to the Workflow reference. Additionally, more attribute descriptions have been added to increase code readability and comprehension.
* Removed unnecessary brackets
* Remove unused services from workflow management
This commit deletes "ExpressionDescriptorRegistryPopulator.cs" and "ScopedWorkflowDefinitionLookup.cs" files from Elsa.Workflows.Management.Services. These files, containing obsolete services, are no longer used in the workflow management process. The services' registration has been removed as well from "WorkflowManagementFeature.cs".
* Remove TestWorkflowDefinitionService.cs from component tests
A file, TestWorkflowDefinitionService.cs, was removed under Elsa.Workflows.ComponentTests. This is part of the improvement process where inefficient or unnecessary test files are cleaned up.
* Add comments to WorkflowDefinitionActivityTests
This commit adds explanatory comments to the WorkflowDefinitionActivityTests file. The comments provide information about the purpose of these tests and a reference to a related issue in the project's Github repository.
* Updated duplicate and missing package references
---------
Co-authored-by: Raymond den Haan <raymond.den.haan@nexxbiz.io>
* Add application component tests
Multiple new test files were added to deliver application component tests. This move improves testing by adding integration tests that cover overall system behavior and checking end-to-end actions. Ensuring the system functions correctly as a whole. In the process, updating some package versions to maintain compatibility.
* Add RefitSettings helper and revise API client service configuration
The commit introduces a 'RefitSettingsHelper' for Elsa API client and revises the way the API client services are configured. It also makes improvements to the WorkflowServerTestWebAppFactory for component testing. Some endpoint contracts related to workflow execution are also updated to have optional parameters.
* Remove old tests and add new workflow tests
This commit removes old, unnecessary tests and incorporates new workflow tests. It also improves the Elsa API client JSON serializer and adds a helper for HttpResponseMessage. Lastly, the commit introduces changes to properly configure the test logging and to manage application settings.
* Add HttpHelloWorld workflow tests
A new component test scenario, HttpHelloWorldTests, has been created for testing an HttpHelloWorld workflow. This involves asserting if a workflow responds correctly with "Hello World". Furthermore, an HTTP workflow client has been introduced in the WorkflowServerTestWebAppFactory class to provide a base address for workflow API calls.
* Add new test file and update workflow execution tests
This change adds a new test file "fork-1.json" to the Elsa.Workflows.Api.ComponentTests project. Also, updates were made throughout the tests to replace the WorkflowServerTestWebAppFactory with a fixture, allowing the tests to run in parallel. Lastly, unnecessary warning suppression was removed from the Elsa.Workflows.Core extension method.
* Add filter for .json and .elsa files in BlobStorageWorkflowProvider
This change adds a BrowseFilter in the BlobStorageWorkflowProvider options. This filter checks for files that end with .json or .elsa and includes only these files when browsing through the blob storage. This filter helps prioritize specific workflow file types.
* Rename WorkflowServerTestWebAppFactoryFixture and update usage
The old class name "WorkflowServerTestWebAppFactoryFixture" has been replaced with the more accurate "WorkflowServerWebAppFactoryFixture". All references to the previous name in other classes were also updated accordingly. In addition, the directory key in the method "CreateConvoyOptionsBuilder" has been updated from "Workflows" to "Scenarios".
* Update test fixture in workflow tests
The commit updates the test fixture in two test classes: HttpHelloWorldTests and HelloWorldTests. The former test fixture, WorkflowServerTestWebAppFactoryFixture, was replaced by WorkflowServerWebAppFactoryFixture to accurately match the testing needs.
* Update .csproj file paths and reorganize tests
The commit modifies the file paths for several test scenario files in the Elsa.Workflows.Api.ComponentTests.csproj, reflecting a reorganization of the tests. Previously static paths have been updated to new paths under 'Scenarios'. Additionally, two new test files related to 'LogPersistenceModes' have been included in the project.
* Add tests for log persistence modes
This commit introduces two new test scenarios for logging persistence modes and includes a related test called 'HelloWorldWorkflow'. These tests cover scenarios where certain workflow inputs should be stored and others shouldn't, thereby testing the log persistence feature. This ensures that the logging behavior respects the specified persistence mode.
* Add log persistence tests and update LogPersistenceMode enum
The commit contains the addition of new log persistence tests for verifying correctness of log persistence behavior. Furthermore, the LogPersistenceMode enum has been updated, replacing 'Default' with 'Inherit'. This change makes the mode's purpose clearer. Lastly, new test scenarios and test data files were added for more comprehensive testing.
* Remove obsolete component tests and support files
The files removed are no longer necessary for the current state of the application. They include various component tests and their related support files within the Elsa.Workflows.Api.ComponentTests project. By removing these, the project structure is cleaner and only contains relevant tests.
* Add dispatch workflow scenario tests and necessary helper classes
This commit includes two new tests for dispatching workflows, along with the creation of new 'ChildWorkflow' and 'DispatchAndWaitWorkflow' classes. Auxiliary helpers and services have been added to aid in managing workflow events and signals for these tests. The 'ComponentTest' has also been upgraded to support disposal handling.
* Remove ITestOutputHelper dependency from test classes
Removed the dependency on ITestOutputHelper in multiple test classes across various workflow scenarios. This change simplifies the test class constructors by reducing the number of required dependencies, contributing to cleaner and leaner code.
* Add 'Hello World' scenario to WorkflowCompletion tests
The 'Hello World' scenario was moved into WorkflowCompletion tests, along with changes in workflow definition identifiers. As part of these changes, the 'hello-world.json' file was updated; a new file under the same name was created in the WorkflowCompletion area and the workflow identifiers in basic and workflow completion tests were updated accordingly. Additionally, 'fork-1.json' has been renamed to 'fork.json'.
* Add support for cluster hosting tests
This commit introduces a suite of integration tests designed to validate the behaviour of hosting multiple instances of Elsa in a clustered environment. These tests simulate a typical clustered hosting scenario by using 'App', 'Cluster', and 'Infrastructure' objects to emulate different instances of the Elsa workflow engine running on separate servers. Name changes were made to certain classes and methods to reflect their new scopes and roles within the testing environment.
* Add performance tests and improve component tests
Added a new performance tests project scaffold, complete with its own project file, build properties file, and a dummy test. Updated component tests to improve multi-pod testing, primarily through the addition of additional service scopes and asserting activity registry synchronization. These changes also required updates to existing project and props files as well as the solution file.
* Update ActivityRegistrySyncTests and Infrastructure
Added a reference to Services in ActivityRegistrySyncTests and removed unnecessary whitespace in both files. The test component Elsa.Workflows has been modified to import newly added services, ensuring all tests are running with the expected resources and services.
* Fix comment
* Add NOOP implementations for stores
* Update PostgreSQL image and adjust test timings
The PostgreSQL image used for testing has been updated to the latest version from 13.3-alpine. Timeouts in ISignalManager and DispatchWorkflowsTests have been reduced for efficiency. A delay in the ChildWorkflow has also been decreased. Additionally, an 'ImportWorkflowActivity' test in ActivityRegistrySyncTests has been marked as not yet implemented.
Adds an XUnit test logger to each test csproj
file (will be used by test script).
Also add a skeleton SonarCloud analysis config file with a couple
of settings for starters: Don't analyse exception classes or samples
for coverage.
This reverts commit 3dc1b79b3b, reversing
changes made to 1dbafd8ba2.
The previous merge of work on #665 broke the build so this commit
reverts it back out.
Adds an XUnit test logger to each test csproj
file (will be used by test script).
Also add a skeleton SonarCloud analysis config file with a couple
of settings for starters: Don't analyse exception classes or samples
for coverage.
* WIP #653 - Delete two tests
These two couldn't easily be fixed, in both cases they were
integration tests which involved passing through many classes.
It wasn't immediately clear what needed to be done to fix them.
As noted in the issue description, removing them was an
acceptable fix.
* WIP #653 - Fix a failing test
I split this test into two. Per the discussion at:
https://github.com/xunit/xunit/issues/350
XUnit seems quite opinonated about not having assertion messages.
Thus, without changing assertion library (which deserves discussion
before I just do it), the logical next best thing is to split into two
single-assert tests, so it's clear which assertion failed on a test
failure.
Also, I moved the AutoMoqData attribute to the shared test lib, so
that it can be used anywhere. That allowed me to eliminate the
constructor for this test class, except for initialising the base class.
* Provisionally resolve#653 - reinstate tests in CI
This should complete the issue although we need to see a
passing CI build with this code change before we can say
it's done.
* Provisionally resolves#653 - Add test script
* Activity picker dialog
* Activity picker
* Activity editor
* Activity property fields
* Blazor bindings for Elsa designer
* Only index triggers from published & enabled workflow definitions
* Handle case of null workflow blueprint not found
* Add check for zero duration and general scheduler exceptions
* Don't rethrow expression evaluation failure
* Workflow definition settings editor modal
* Integration between stencil and blazor 🎉
* Fix expression type conversion
* Add publish button and restructure components
* Fix up workflow definition ID vs workflow definition version ID
* Update EF Core migrations
* Fix Workflow Publisher
* Fix version display
* Add Import menu item