diff --git a/Elsa.sln b/Elsa.sln index 151d71f25..88483a58e 100644 --- a/Elsa.sln +++ b/Elsa.sln @@ -87,7 +87,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "security", "security", "{59 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{B08B4E00-C2AB-48F3-8389-449F42AEF179}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "runtimes", "runtimes", "{58C59255-281C-4595-8732-808158F1DC6E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_runtimes", "_runtimes", "{58C59255-281C-4595-8732-808158F1DC6E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Mediator", "src\common\Elsa.Mediator\Elsa.Mediator.csproj", "{28818676-F6AF-4203-8B65-BD33A50CB9A2}" EndProject @@ -110,8 +110,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.cspr EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{C80C8231-D35C-4ACC-9ED6-9F3DB221535E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Alterations.IntegrationTests", "test\integration\Elsa.Alterations.IntegrationTests\Elsa.Alterations.IntegrationTests.csproj", "{F50336DA-42D1-4DD1-A107-67AFEB8A33EE}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hosting", "hosting", "{A516931E-EDBB-4FC3-BB94-1BB824D5BC61}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Hosting.Management", "src\modules\Elsa.Hosting.Management\Elsa.Hosting.Management.csproj", "{BBCE36D1-6767-4ED1-B3E8-84D2567A962A}" @@ -129,8 +127,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "performance", "performance" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.PerformanceTests", "test\performance\Elsa.Workflows.PerformanceTests\Elsa.Workflows.PerformanceTests.csproj", "{90CD37A9-C866-4D90-A3B1-8C87F53B845E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.MongoDb.UnitTests", "test\unit\Elsa.MongoDb.UnitTests\Elsa.MongoDb.UnitTests.csproj", "{56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Workflows.Runtime.Distributed", "src\modules\Elsa.Workflows.Runtime.Distributed\Elsa.Workflows.Runtime.Distributed.csproj", "{0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Testing.Shared", "src\common\Elsa.Testing.Shared\Elsa.Testing.Shared.csproj", "{5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4}" @@ -346,10 +342,6 @@ Global {29638A67-E79F-44FE-AC05-DA499EBA929E}.Release|Any CPU.Build.0 = Release|Any CPU {99F2B1DA-2F69-4D70-A2A3-AC985AD91EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {99F2B1DA-2F69-4D70-A2A3-AC985AD91EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE}.Release|Any CPU.Build.0 = Release|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Debug|Any CPU.Build.0 = Debug|Any CPU {BBCE36D1-6767-4ED1-B3E8-84D2567A962A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -370,10 +362,6 @@ Global {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Debug|Any CPU.Build.0 = Debug|Any CPU {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Release|Any CPU.ActiveCfg = Release|Any CPU {90CD37A9-C866-4D90-A3B1-8C87F53B845E}.Release|Any CPU.Build.0 = Release|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1}.Release|Any CPU.Build.0 = Release|Any CPU {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -502,7 +490,6 @@ Global {28818676-F6AF-4203-8B65-BD33A50CB9A2} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {DC9CCAD0-7363-4691-B964-FF5B3AEA3F95} = {18453B51-25EB-4317-A4B3-B10518252E92} {29638A67-E79F-44FE-AC05-DA499EBA929E} = {2F3E1026-5054-4E1F-899B-F1A7F70F9912} - {F50336DA-42D1-4DD1-A107-67AFEB8A33EE} = {1B8D5897-902E-4632-8698-E89CAF3DDF54} {A516931E-EDBB-4FC3-BB94-1BB824D5BC61} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} {BBCE36D1-6767-4ED1-B3E8-84D2567A962A} = {A516931E-EDBB-4FC3-BB94-1BB824D5BC61} {73BBB1E3-AEEC-44E8-83D7-6DD9CD687FE3} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79} @@ -510,7 +497,6 @@ Global {34BC9836-681D-43A5-BC39-E4FEE17FC528} = {08B41FFA-CEE3-46A7-B5C0-3EB65D37A16C} {CBB515F3-A0EF-43B5-A907-FD4E652DD66E} = {90031D64-CA0F-46D0-9AF4-8DC023A5FFCD} {90CD37A9-C866-4D90-A3B1-8C87F53B845E} = {CBB515F3-A0EF-43B5-A907-FD4E652DD66E} - {56CAA9F2-1882-4EFA-BAC0-9C3D804553F1} = {18453B51-25EB-4317-A4B3-B10518252E92} {0D4A88A1-8AEE-49ED-BC2E-ED68C96F60AD} = {58C59255-281C-4595-8732-808158F1DC6E} {5CBCBEA4-6038-48CA-B45D-C1D0F6B4ACA4} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} {94A61AD7-2A2B-40DB-81F3-C59D596958A8} = {C6658DE0-2B2F-47F0-BB61-2CA66D435C09} diff --git a/test/integration/Elsa.Alterations.IntegrationTests/Elsa.Alterations.IntegrationTests.csproj b/test/integration/Elsa.Alterations.IntegrationTests/Elsa.Alterations.IntegrationTests.csproj deleted file mode 100644 index 501b2f97b..000000000 --- a/test/integration/Elsa.Alterations.IntegrationTests/Elsa.Alterations.IntegrationTests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - Always - - - Always - - - - diff --git a/test/integration/Elsa.Alterations.IntegrationTests/MigrationTests.cs b/test/integration/Elsa.Alterations.IntegrationTests/MigrationTests.cs deleted file mode 100644 index e99662fad..000000000 --- a/test/integration/Elsa.Alterations.IntegrationTests/MigrationTests.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Elsa.Alterations.AlterationTypes; -using Elsa.Alterations.Core.Contracts; -using Elsa.Alterations.Extensions; -using Elsa.Common.Models; -using Elsa.Extensions; -using Elsa.Testing.Shared; -using Elsa.Workflows.Management; -using Microsoft.Extensions.DependencyInjection; -using Xunit.Abstractions; - -namespace Elsa.Alterations.IntegrationTests; - -/// -/// Contains tests for migration. -/// -public class MigrationTests -{ - private readonly CapturingTextWriter _capturingTextWriter = new(); - private readonly IServiceProvider _services; - private readonly IAlterationRunner _alterationRunner; - private readonly IWorkflowInstanceStore _workflowInstanceStore; - - /// - /// Initializes a new instance of the class. - /// - public MigrationTests(ITestOutputHelper testOutputHelper) - { - _services = new TestApplicationBuilder(testOutputHelper) - .WithCapturingTextWriter(_capturingTextWriter) - .ConfigureElsa(elsa => elsa.UseAlterations()) - .Build(); - _alterationRunner = _services.GetRequiredService(); - _workflowInstanceStore = _services.GetRequiredService(); - } - - /// - /// This method tests the migration from version 1 to version 2. - /// - [Fact(DisplayName = "Migrating from version 1 to 2 succeeds")] - public async Task Test1() - { - // Populate registries. - await _services.PopulateRegistriesAsync(); - - // Import workflows. - await _services.ImportWorkflowDefinitionAsync("Workflows/version-1.json"); - await _services.ImportWorkflowDefinitionAsync("Workflows/version-2.json"); - - // Run version 1 workflow. - var workflowState = await _services.RunWorkflowUntilEndAsync("my-workflow", versionOptions: VersionOptions.SpecificVersion(1)); - - // Migrate to version 2. - var alterations = new IAlteration[] - { - new Migrate - { - TargetVersion = 2 - } - }; - var instanceIds = new[] - { - workflowState.Id - }; - var migrationResult = await _alterationRunner.RunAsync(instanceIds, alterations); - - // Assert success. - Assert.True(migrationResult.All(x => x.IsSuccessful)); - - // Assert that the workflow instance is now at version 2. - var workflowState2 = await _workflowInstanceStore.FindAsync(workflowState.Id); - Assert.Equal(2, workflowState2!.Version); - } -} \ No newline at end of file diff --git a/test/integration/Elsa.Alterations.IntegrationTests/Usings.cs b/test/integration/Elsa.Alterations.IntegrationTests/Usings.cs deleted file mode 100644 index 8c927eb74..000000000 --- a/test/integration/Elsa.Alterations.IntegrationTests/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Xunit; \ No newline at end of file diff --git a/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-1.json b/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-1.json deleted file mode 100644 index 83fa59c7f..000000000 --- a/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-1.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id": "b760f121e7dc5dae", - "definitionId": "my-workflow", - "name": "Version 1", - "version": 1, - "toolVersion": "3.0.0.0", - "root": { - "type": "Elsa.Flowchart", - "version": 1, - "id": "52ae1d65f7896a9e", - "nodeId": "Workflow1:52ae1d65f7896a9e", - "activities": [ - { - "text": { - "typeName": "String", - "expression": { - "type": "Literal", - "value": "Version 1" - } - }, - "id": "3a1ab61a351fe232", - "nodeId": "Workflow1:52ae1d65f7896a9e:3a1ab61a351fe232", - "name": "WriteLine1", - "type": "Elsa.WriteLine", - "metadata": { - "designer": { - "position": { - "x": -121.796875, - "y": 272 - }, - "size": { - "width": 139.296875, - "height": 50 - } - } - } - } - ], - "connections": [] - } -} \ No newline at end of file diff --git a/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-2.json b/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-2.json deleted file mode 100644 index e4f56e43c..000000000 --- a/test/integration/Elsa.Alterations.IntegrationTests/Workflows/version-2.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id": "4aca2e3aa79475d3", - "definitionId": "my-workflow", - "name": "Version 2", - "version": 2, - "toolVersion": "3.0.0.0", - "root": { - "type": "Elsa.Flowchart", - "version": 1, - "id": "52ae1d65f7896a9e", - "nodeId": "Workflow1:52ae1d65f7896a9e", - "activities": [ - { - "text": { - "typeName": "String", - "expression": { - "type": "Literal", - "value": "Version 2" - } - }, - "id": "3a1ab61a351fe232", - "nodeId": "Workflow1:52ae1d65f7896a9e:3a1ab61a351fe232", - "name": "WriteLine1", - "type": "Elsa.WriteLine", - "metadata": { - "designer": { - "position": { - "x": -121.796875, - "y": 272 - }, - "size": { - "width": 139.296875, - "height": 50 - } - } - } - } - ], - "connections": [] - } -} \ No newline at end of file diff --git a/test/integration/Elsa.Workflows.IntegrationTests/Elsa.Workflows.IntegrationTests.csproj b/test/integration/Elsa.Workflows.IntegrationTests/Elsa.Workflows.IntegrationTests.csproj index 74bf453d5..331bcbc4a 100644 --- a/test/integration/Elsa.Workflows.IntegrationTests/Elsa.Workflows.IntegrationTests.csproj +++ b/test/integration/Elsa.Workflows.IntegrationTests/Elsa.Workflows.IntegrationTests.csproj @@ -5,16 +5,16 @@ - + + + + + - - - - diff --git a/test/unit/Elsa.MongoDb.UnitTests/Elsa.MongoDb.UnitTests.csproj b/test/unit/Elsa.MongoDb.UnitTests/Elsa.MongoDb.UnitTests.csproj deleted file mode 100644 index a729c87e8..000000000 --- a/test/unit/Elsa.MongoDb.UnitTests/Elsa.MongoDb.UnitTests.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - net9.0 - - - - - - diff --git a/test/unit/Elsa.MongoDb.UnitTests/MongoKeyValueStoreTests.cs b/test/unit/Elsa.MongoDb.UnitTests/MongoKeyValueStoreTests.cs deleted file mode 100644 index 3972e34f7..000000000 --- a/test/unit/Elsa.MongoDb.UnitTests/MongoKeyValueStoreTests.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Elsa.Common.Multitenancy; -using Elsa.KeyValues.Entities; -using Elsa.MongoDb.Common; -using Elsa.MongoDb.Modules.Runtime; -using MongoDB.Driver; -using NSubstitute; - -namespace Elsa.MongoDb.UnitTests; - -public class MongoKeyValueStoreTests -{ - private readonly MongoDbStore _mongoDbStore; - - public MongoKeyValueStoreTests() - { - var mongoCollectionMock = Substitute.For>(); - var tenantAccessorMock = Substitute.For(); - mongoCollectionMock.FindOneAndReplaceAsync( - Arg.Any>(), - Arg.Any(), - Arg.Any>() - ) - .Returns(new SerializedKeyValuePair()); - _mongoDbStore = new MongoDbStore(mongoCollectionMock, tenantAccessorMock); - } - - [Fact(DisplayName = "When saving a SerializedKeyValuePair document, don't throw an exception of missing ID property")] - public async Task SaveAsync_WithSerializedKeyValuePairDocument_DoesNotThrowException() - { - var mongoKeyValueStore = new MongoKeyValueStore(_mongoDbStore); - var keyValuePair = new SerializedKeyValuePair(); - - var exception = await Record.ExceptionAsync( - async () => await mongoKeyValueStore.SaveAsync(keyValuePair, default)); - - Assert.Null(exception); - } -} \ No newline at end of file diff --git a/test/unit/Elsa.MongoDb.UnitTests/Usings.cs b/test/unit/Elsa.MongoDb.UnitTests/Usings.cs deleted file mode 100644 index 8c927eb74..000000000 --- a/test/unit/Elsa.MongoDb.UnitTests/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Xunit; \ No newline at end of file