Skip to content

Commit

Permalink
IWF-439: Add comments for integration test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
stevo89519 committed Jan 17, 2025
1 parent ff994be commit af57a96
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 3 deletions.
6 changes: 3 additions & 3 deletions integ/workflow/interstate/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
* - WaitUntil will proceed once channel1 has been published to
* - Execute method will move to State31:
* State22:
* - WaitUntil delays 2 seconds then publishes on the first channel
* - Execute method will delay 2s publish on channel2 & end in a dead-end
* - WaitUntil will delay 2s then publish on channel1
* - Execute method will delay 2s then publish on channel2 & end in a dead-end
* State31:
* - WaitUntil will proceed once channel2 has been published to
* - Execute method will gracefully complete workflow
Expand Down Expand Up @@ -111,7 +111,7 @@ func (h *handler) ApiV1WorkflowStateStart(c *gin.Context) {
return
}

// Wait 2 seconds then publish on the first channel
// Wait 2 seconds then publish on channel1
if req.GetWorkflowStateId() == State22 {
time.Sleep(time.Second * 2)
c.JSON(http.StatusOK, iwfidl.WorkflowStateStartResponse{
Expand Down
13 changes: 13 additions & 0 deletions integ/workflow/locking/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ import (
"time"
)

/**
* This test workflow has three states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil method does nothing
* - Execute method will move to State Waiting, and 10 instances of State 2
* State2:
* - WaitUntil update SA
* - Execute method will update data objects and will gracefully complete workflow
* StateWaiting:
* - WaitUntil will proceed once the internal channel has been published to
* - Execute method will gracefully complete workflow
*/
const (
WorkflowType = "locking"
State1 = "S1"
Expand Down
28 changes: 28 additions & 0 deletions integ/workflow/parallel/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,34 @@ import (
"time"
)

/**
* This test workflow has eight states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil method does nothing
* - Execute method delays 1s then moves to State11, State12, & State13
* State11:
* - WaitUntil method does nothing
* - Execute method delays 2s then moves to State111 & State112
* State12:
* - WaitUntil method does nothing
* - Execute method delays 2s then moves to State121 & State122
* State13:
* - WaitUntil method does nothing
* - Execute method will delay 1s then gracefully complete workflow
* State111:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
* State112:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
* State121:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
* State122:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
*/
const (
WorkflowType = "parallel"
State1 = "S1"
Expand Down
13 changes: 13 additions & 0 deletions integ/workflow/persistence/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ import (
"net/http"
)

/**
* This test workflow has three states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil method will update DA, SA, & SL
* - Execute method will move to State2 with partially loaded data
* State2:
* - WaitUntil method will store attribute data
* - Execute method will move to State3 with partially loaded data
* State3:
* - WaitUntil method performs some attribute checks
* - Execute method performs checks on the attribute data and then gracefully completes the workflow
*/
const (
WorkflowType = "persistence"
State1 = "S1"
Expand Down
10 changes: 10 additions & 0 deletions integ/workflow/persistence_loading_policy/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import (
"net/http"
)

/**
* This test workflow has two states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil skipped
* - Execute method verifies the loaded attributes then moves to a dead-end.
* State2:
* - WaitUntil method verifies the loaded attributes
* - Execute method verifies the loaded attributes then gracefully completes the workflow
*/
const (
WorkflowType = "persistence_loading_policy"
State1 = "S1"
Expand Down
10 changes: 10 additions & 0 deletions integ/workflow/rpc/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ import (
"net/http"
)

/**
* This test workflow has two states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil updates attribute data and data objects and then waits until the channel has been published to
* - Execute method moves to State2
* State2:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
*/
const (
WorkflowType = "rpc"
State1 = "S1"
Expand Down
10 changes: 10 additions & 0 deletions integ/workflow/signal/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import (
"net/http"
)

/**
* This test workflow has two states, using REST controller to implement the workflow directly.
*
* State1:
* - WaitUntil waits until 4 signals are received
* - Execute method publishes the 4 signals & moves to State2
* State2:
* - WaitUntil method does nothing
* - Execute method will gracefully complete workflow
*/
const (
WorkflowType = "signal"
State1 = "S1"
Expand Down

0 comments on commit af57a96

Please sign in to comment.