gwen-interpreter / gwen

Core Gwen interpreter
https://gweninterpreter.org
Apache License 2.0
36 stars 8 forks source link

Introduce synchronized StepDef execution #45

Closed bjuric closed 6 years ago

bjuric commented 6 years ago

This feature introduces a @Synchronized annotation for StepDefs. All the steps in a StepDef with this annotation will run in a single feature thread when called by multiple features in the case of parallel execution.

For example, the 3 steps in the following step definition would execute for one feature only at any one time when called by multiple features running in parallel.

@Synchronized
@StepDef
Scenario: I run in a single feature thread
    Given step 1
     When step 2
     Then step 3

The @Synchronized annotation is ignored when features are executed in serial (non parallel) mode.


This feature was originally requested through PR gwen-interpreter/gwen-web#63 raised by @ @rkevin99 and implemented here using a different approach.