diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/BranchFeatureTests.cs b/tests/Synapse.UnitTests/Cases/Conformance/Features/BranchFeatureTests.cs new file mode 100644 index 000000000..b9238d51f --- /dev/null +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/BranchFeatureTests.cs @@ -0,0 +1,25 @@ +// Copyright © 2024-Present The Synapse Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"), +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Xunit.Gherkin.Quick; + +namespace Synapse.UnitTests.Cases.Conformance.Features; + +[FeatureFile("./Cases/Conformance/Features/branch.feature")] +public class BranchFeatureTests + : ConformanceTestsBase +{ + + + +} diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/branch.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/branch.feature new file mode 100644 index 000000000..481f73ade --- /dev/null +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/branch.feature @@ -0,0 +1,32 @@ +Feature: Composite Task + As an implementer of the workflow DSL + I want to ensure that composite tasks can be executed within the workflow + So that my implementation conforms to the expected behavior + + # Tests composite tasks With competing concurrent sub tasks + Scenario: Fork Task With Competing Concurrent Sub Tasks + Given a workflow with definition: + """yaml + document: + dsl: '1.0.0-alpha5' + namespace: default + name: fork + version: '1.0.0' + do: + - branchWithCompete: + fork: + compete: true + branches: + - setRed: + set: + colors: ${ .colors + ["red"] } + - setGreen: + set: + colors: ${ .colors + ["green"] } + - setBlue: + set: + colors: ${ .colors + ["blue"] } + """ + When the workflow is executed + Then the workflow should complete + And the workflow output should have a 'colors' property containing 1 items \ No newline at end of file diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature index 1b590a6da..c78f894f3 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature @@ -11,9 +11,10 @@ Feature: Call Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: http-call-with-content-output + version: '1.0.0' do: - findPet: call: http @@ -39,9 +40,10 @@ Feature: Call Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: http-call-with-response-output + version: '1.0.0' do: - getPet: call: http @@ -66,9 +68,10 @@ Feature: Call Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: http-call-with-basic-auth + version: '1.0.0' do: - login: call: http @@ -95,9 +98,10 @@ Feature: Call Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: openapi-call-with-content-output + version: '1.0.0' do: - findPet: call: openapi @@ -123,9 +127,10 @@ Feature: Call Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: openapi-call-with-response-output + version: '1.0.0' do: - getPet: call: openapi diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/data-flow.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/data-flow.feature index fefc4dc00..73b4af5b8 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/data-flow.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/data-flow.feature @@ -8,9 +8,10 @@ Feature: Data Flow Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: output-filtering + version: '1.0.0' do: - setPlayerId: input: @@ -35,9 +36,10 @@ Feature: Data Flow Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: output-filtering + version: '1.0.0' do: - getPet: call: http @@ -63,9 +65,10 @@ Feature: Data Flow Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: non-object-output + version: '1.0.0' do: - getPetById1: call: http diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/do.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/do.feature index e84aa7d37..9c894190b 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/do.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/do.feature @@ -8,9 +8,10 @@ Feature: Composite Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: do + version: '1.0.0' do: - compositeExample: do: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/emit.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/emit.feature index 871ec7f25..9e33df051 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/emit.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/emit.feature @@ -8,9 +8,10 @@ Feature: Emit Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: emit + version: '1.0.0' do: - emitEvent: emit: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/flow.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/flow.feature index 169179466..b5a7b3fe4 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/flow.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/flow.feature @@ -7,9 +7,10 @@ Feature: Flow Directive Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: implicit-sequence + version: '1.0.0' do: - setRed: set: @@ -34,9 +35,10 @@ Feature: Flow Directive Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: explicit-sequence + version: '1.0.0' do: - setRed: set: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/for.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/for.feature index 3ac783e5a..c36bf65b8 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/for.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/for.feature @@ -10,9 +10,10 @@ Feature: For Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: for + version: '1.0.0' do: - loopColors: for: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/raise.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/raise.feature index 8fac72401..f4d022212 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/raise.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/raise.feature @@ -7,9 +7,10 @@ Feature: Raise Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: raise-custom-error + version: '1.0.0' do: - raiseError: raise: @@ -25,4 +26,4 @@ Feature: Raise Task type: https://serverlessworkflow.io/errors/types/compliance title: Compliance Error instance: /do/0/raiseError - """ \ No newline at end of file + """ diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/set.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/set.feature index c5fd43954..eaae30f13 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/set.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/set.feature @@ -8,9 +8,10 @@ Feature: Set Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: set + version: '1.0.0' do: - setShape: set: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/switch.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/switch.feature index bba64c00f..e56c5dc43 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/switch.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/switch.feature @@ -7,9 +7,10 @@ Feature: Switch Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: switch-match + version: '1.0.0' do: - switchColor: switch: @@ -51,9 +52,10 @@ Feature: Switch Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: switch-default-implicit + version: '1.0.0' do: - switchColor: switch: @@ -93,9 +95,10 @@ Feature: Switch Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: switch-default-implicit + version: '1.0.0' do: - switchColor: switch: diff --git a/tests/Synapse.UnitTests/Cases/Conformance/Features/try.feature b/tests/Synapse.UnitTests/Cases/Conformance/Features/try.feature index e67773f3b..404e5604c 100644 --- a/tests/Synapse.UnitTests/Cases/Conformance/Features/try.feature +++ b/tests/Synapse.UnitTests/Cases/Conformance/Features/try.feature @@ -11,9 +11,10 @@ Feature: Try Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: try-catch-404 + version: '1.0.0' do: - tryGetPet: try: @@ -54,9 +55,10 @@ Feature: Try Task Given a workflow with definition: """yaml document: - dsl: 1.0.0-alpha1 + dsl: '1.0.0-alpha5' namespace: default name: try-catch-503 + version: '1.0.0' do: - tryGetPet: try: diff --git a/tests/Synapse.UnitTests/Synapse.UnitTests.csproj b/tests/Synapse.UnitTests/Synapse.UnitTests.csproj index c2a6e7326..006a06bb2 100644 --- a/tests/Synapse.UnitTests/Synapse.UnitTests.csproj +++ b/tests/Synapse.UnitTests/Synapse.UnitTests.csproj @@ -45,6 +45,9 @@ + + PreserveNewest + PreserveNewest