Skip to content

Commit 9131dba

Browse files
authored
Merge pull request #452 from serverlessworkflow/test-conformance-update
Updated conformance tests
2 parents 60ed01d + bcd4715 commit 9131dba

File tree

13 files changed

+101
-21
lines changed

13 files changed

+101
-21
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright © 2024-Present The Synapse Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"),
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
using Xunit.Gherkin.Quick;
15+
16+
namespace Synapse.UnitTests.Cases.Conformance.Features;
17+
18+
[FeatureFile("./Cases/Conformance/Features/branch.feature")]
19+
public class BranchFeatureTests
20+
: ConformanceTestsBase
21+
{
22+
23+
24+
25+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Feature: Composite Task
2+
As an implementer of the workflow DSL
3+
I want to ensure that composite tasks can be executed within the workflow
4+
So that my implementation conforms to the expected behavior
5+
6+
# Tests composite tasks With competing concurrent sub tasks
7+
Scenario: Fork Task With Competing Concurrent Sub Tasks
8+
Given a workflow with definition:
9+
"""yaml
10+
document:
11+
dsl: '1.0.0-alpha5'
12+
namespace: default
13+
name: fork
14+
version: '1.0.0'
15+
do:
16+
- branchWithCompete:
17+
fork:
18+
compete: true
19+
branches:
20+
- setRed:
21+
set:
22+
colors: ${ .colors + ["red"] }
23+
- setGreen:
24+
set:
25+
colors: ${ .colors + ["green"] }
26+
- setBlue:
27+
set:
28+
colors: ${ .colors + ["blue"] }
29+
"""
30+
When the workflow is executed
31+
Then the workflow should complete
32+
And the workflow output should have a 'colors' property containing 1 items

tests/Synapse.UnitTests/Cases/Conformance/Features/call.feature

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Feature: Call Task
1111
Given a workflow with definition:
1212
"""yaml
1313
document:
14-
dsl: 1.0.0-alpha1
14+
dsl: '1.0.0-alpha5'
1515
namespace: default
1616
name: http-call-with-content-output
17+
version: '1.0.0'
1718
do:
1819
- findPet:
1920
call: http
@@ -39,9 +40,10 @@ Feature: Call Task
3940
Given a workflow with definition:
4041
"""yaml
4142
document:
42-
dsl: 1.0.0-alpha1
43+
dsl: '1.0.0-alpha5'
4344
namespace: default
4445
name: http-call-with-response-output
46+
version: '1.0.0'
4547
do:
4648
- getPet:
4749
call: http
@@ -66,9 +68,10 @@ Feature: Call Task
6668
Given a workflow with definition:
6769
"""yaml
6870
document:
69-
dsl: 1.0.0-alpha1
71+
dsl: '1.0.0-alpha5'
7072
namespace: default
7173
name: http-call-with-basic-auth
74+
version: '1.0.0'
7275
do:
7376
- login:
7477
call: http
@@ -95,9 +98,10 @@ Feature: Call Task
9598
Given a workflow with definition:
9699
"""yaml
97100
document:
98-
dsl: 1.0.0-alpha1
101+
dsl: '1.0.0-alpha5'
99102
namespace: default
100103
name: openapi-call-with-content-output
104+
version: '1.0.0'
101105
do:
102106
- findPet:
103107
call: openapi
@@ -123,9 +127,10 @@ Feature: Call Task
123127
Given a workflow with definition:
124128
"""yaml
125129
document:
126-
dsl: 1.0.0-alpha1
130+
dsl: '1.0.0-alpha5'
127131
namespace: default
128132
name: openapi-call-with-response-output
133+
version: '1.0.0'
129134
do:
130135
- getPet:
131136
call: openapi

tests/Synapse.UnitTests/Cases/Conformance/Features/data-flow.feature

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Feature: Data Flow
88
Given a workflow with definition:
99
"""yaml
1010
document:
11-
dsl: 1.0.0-alpha1
11+
dsl: '1.0.0-alpha5'
1212
namespace: default
1313
name: output-filtering
14+
version: '1.0.0'
1415
do:
1516
- setPlayerId:
1617
input:
@@ -35,9 +36,10 @@ Feature: Data Flow
3536
Given a workflow with definition:
3637
"""yaml
3738
document:
38-
dsl: 1.0.0-alpha1
39+
dsl: '1.0.0-alpha5'
3940
namespace: default
4041
name: output-filtering
42+
version: '1.0.0'
4143
do:
4244
- getPet:
4345
call: http
@@ -63,9 +65,10 @@ Feature: Data Flow
6365
Given a workflow with definition:
6466
"""yaml
6567
document:
66-
dsl: 1.0.0-alpha1
68+
dsl: '1.0.0-alpha5'
6769
namespace: default
6870
name: non-object-output
71+
version: '1.0.0'
6972
do:
7073
- getPetById1:
7174
call: http

tests/Synapse.UnitTests/Cases/Conformance/Features/do.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Feature: Composite Task
88
Given a workflow with definition:
99
"""yaml
1010
document:
11-
dsl: 1.0.0-alpha1
11+
dsl: '1.0.0-alpha5'
1212
namespace: default
1313
name: do
14+
version: '1.0.0'
1415
do:
1516
- compositeExample:
1617
do:

tests/Synapse.UnitTests/Cases/Conformance/Features/emit.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Feature: Emit Task
88
Given a workflow with definition:
99
"""yaml
1010
document:
11-
dsl: 1.0.0-alpha1
11+
dsl: '1.0.0-alpha5'
1212
namespace: default
1313
name: emit
14+
version: '1.0.0'
1415
do:
1516
- emitEvent:
1617
emit:

tests/Synapse.UnitTests/Cases/Conformance/Features/flow.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Feature: Flow Directive
77
Given a workflow with definition:
88
"""yaml
99
document:
10-
dsl: 1.0.0-alpha1
10+
dsl: '1.0.0-alpha5'
1111
namespace: default
1212
name: implicit-sequence
13+
version: '1.0.0'
1314
do:
1415
- setRed:
1516
set:
@@ -34,9 +35,10 @@ Feature: Flow Directive
3435
Given a workflow with definition:
3536
"""yaml
3637
document:
37-
dsl: 1.0.0-alpha1
38+
dsl: '1.0.0-alpha5'
3839
namespace: default
3940
name: explicit-sequence
41+
version: '1.0.0'
4042
do:
4143
- setRed:
4244
set:

tests/Synapse.UnitTests/Cases/Conformance/Features/for.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Feature: For Task
1010
Given a workflow with definition:
1111
"""yaml
1212
document:
13-
dsl: 1.0.0-alpha1
13+
dsl: '1.0.0-alpha5'
1414
namespace: default
1515
name: for
16+
version: '1.0.0'
1617
do:
1718
- loopColors:
1819
for:

tests/Synapse.UnitTests/Cases/Conformance/Features/raise.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Feature: Raise Task
77
Given a workflow with definition:
88
"""yaml
99
document:
10-
dsl: 1.0.0-alpha1
10+
dsl: '1.0.0-alpha5'
1111
namespace: default
1212
name: raise-custom-error
13+
version: '1.0.0'
1314
do:
1415
- raiseError:
1516
raise:
@@ -25,4 +26,4 @@ Feature: Raise Task
2526
type: https://serverlessworkflow.io/errors/types/compliance
2627
title: Compliance Error
2728
instance: /do/0/raiseError
28-
"""
29+
"""

tests/Synapse.UnitTests/Cases/Conformance/Features/set.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Feature: Set Task
88
Given a workflow with definition:
99
"""yaml
1010
document:
11-
dsl: 1.0.0-alpha1
11+
dsl: '1.0.0-alpha5'
1212
namespace: default
1313
name: set
14+
version: '1.0.0'
1415
do:
1516
- setShape:
1617
set:

0 commit comments

Comments
 (0)