Skip to content

Commit

Permalink
test(Conformance): updated conformance tests [skip hint][skip ci]
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
  • Loading branch information
JBBianchi committed Nov 4, 2024
1 parent 60ed01d commit bcd4715
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -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
{



}
32 changes: 32 additions & 0 deletions tests/Synapse.UnitTests/Cases/Conformance/Features/branch.feature
Original file line number Diff line number Diff line change
@@ -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
15 changes: 10 additions & 5 deletions tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -25,4 +26,4 @@ Feature: Raise Task
type: https://serverlessworkflow.io/errors/types/compliance
title: Compliance Error
instance: /do/0/raiseError
"""
"""
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions tests/Synapse.UnitTests/Synapse.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
</ItemGroup>

<ItemGroup>
<None Update="Cases\Conformance\Features\branch.feature">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Cases\Conformance\Features\try.feature">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

0 comments on commit bcd4715

Please sign in to comment.