Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update process structure: rename process's key to name and move node.*.key into node #1536

Merged
merged 4 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions database/process_db_test.go

This file was deleted.

8 changes: 4 additions & 4 deletions e2e/orchestrator_event_filter_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ func testOrchestratorEventFilterTask(executionStream pb.Execution_StreamClient,

t.Run("create process", func(t *testing.T) {
respProc, err := client.ProcessClient.Create(context.Background(), &pb.CreateProcessRequest{
Key: "event-filter-task-process",
Name: "event-filter-task-process",
Nodes: []*process.Process_Node{
{
Key: "n0",
Type: &process.Process_Node_Event_{
Event: &process.Process_Node_Event{
Key: "n0",
InstanceHash: instanceHash,
EventKey: "test_event",
},
},
},
{
Key: "n1",
Type: &process.Process_Node_Filter_{
Filter: &process.Process_Node_Filter{
Key: "n1",
Conditions: []process.Process_Node_Filter_Condition{
{
Key: "msg",
Expand All @@ -46,9 +46,9 @@ func testOrchestratorEventFilterTask(executionStream pb.Execution_StreamClient,
},
},
{
Key: "n2",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n2",
InstanceHash: instanceHash,
TaskKey: "task1",
},
Expand Down
20 changes: 10 additions & 10 deletions e2e/orchestrator_event_map_task_map_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
t.Skip("this test doesn't work as map cannot access the trigger event")
t.Run("create process", func(t *testing.T) {
respProc, err := client.ProcessClient.Create(context.Background(), &pb.CreateProcessRequest{
Key: "result-map-task-map-task-process",
Name: "result-map-task-map-task-process",
Nodes: []*process.Process_Node{
{
Key: "n0",
Type: &process.Process_Node_Event_{
Event: &process.Process_Node_Event{
Key: "n0",
InstanceHash: instanceHash,
EventKey: "test_event",
},
},
},
{
Key: "n1",
Type: &process.Process_Node_Map_{
Map: &process.Process_Node_Map{
Key: "n1",
Outputs: []*process.Process_Node_Map_Output{
{
Key: "msg",
Expand All @@ -46,18 +46,18 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
},
},
{
Key: "n2",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n2",
InstanceHash: instanceHash,
TaskKey: "task1",
},
},
},
{
Key: "n3",
Type: &process.Process_Node_Map_{
Map: &process.Process_Node_Map{
Key: "n3",
Outputs: []*process.Process_Node_Map_Output{
{
Key: "msg",
Expand All @@ -73,9 +73,9 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
},
},
{
Key: "n4",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n4",
InstanceHash: instanceHash,
TaskKey: "task1",
},
Expand Down Expand Up @@ -117,7 +117,7 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
t.Run("check in progress execution", func(t *testing.T) {
exec, err := executionStream.Recv()
require.NoError(t, err)
require.Equal(t, "n2", exec.StepID)
require.Equal(t, "n2", exec.NodeKey)
require.Equal(t, "task1", exec.TaskKey)
require.True(t, processHash.Equal(exec.ProcessHash))
require.Equal(t, execution.Status_InProgress, exec.Status)
Expand All @@ -126,7 +126,7 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
t.Run("check completed execution", func(t *testing.T) {
exec, err := executionStream.Recv()
require.NoError(t, err)
require.Equal(t, "n2", exec.StepID)
require.Equal(t, "n2", exec.NodeKey)
require.Equal(t, "task1", exec.TaskKey)
require.True(t, processHash.Equal(exec.ProcessHash))
require.Equal(t, execution.Status_Completed, exec.Status)
Expand All @@ -138,7 +138,7 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
t.Run("check in progress execution", func(t *testing.T) {
exec, err := executionStream.Recv()
require.NoError(t, err)
require.Equal(t, "n4", exec.StepID)
require.Equal(t, "n4", exec.NodeKey)
require.Equal(t, "task1", exec.TaskKey)
require.True(t, processHash.Equal(exec.ProcessHash))
require.Equal(t, execution.Status_InProgress, exec.Status)
Expand All @@ -147,7 +147,7 @@ func testOrchestratorEventMapTaskMapTask(executionStream pb.Execution_StreamClie
t.Run("check completed execution", func(t *testing.T) {
exec, err := executionStream.Recv()
require.NoError(t, err)
require.Equal(t, "n4", exec.StepID)
require.Equal(t, "n4", exec.NodeKey)
require.Equal(t, "task1", exec.TaskKey)
require.True(t, processHash.Equal(exec.ProcessHash))
require.Equal(t, execution.Status_Completed, exec.Status)
Expand Down
8 changes: 4 additions & 4 deletions e2e/orchestrator_event_map_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ func testOrchestratorEventMapTask(executionStream pb.Execution_StreamClient, ins

t.Run("create process", func(t *testing.T) {
respProc, err := client.ProcessClient.Create(context.Background(), &pb.CreateProcessRequest{
Key: "event-map-task-process",
Name: "event-map-task-process",
Nodes: []*process.Process_Node{
{
Key: "n0",
Type: &process.Process_Node_Event_{
Event: &process.Process_Node_Event{
Key: "n0",
InstanceHash: instanceHash,
EventKey: "test_event",
},
},
},
{
Key: "n1",
Type: &process.Process_Node_Map_{
Map: &process.Process_Node_Map{
Key: "n1",
Outputs: []*process.Process_Node_Map_Output{
{
Key: "msg",
Expand All @@ -46,9 +46,9 @@ func testOrchestratorEventMapTask(executionStream pb.Execution_StreamClient, ins
},
},
{
Key: "n2",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n2",
InstanceHash: instanceHash,
TaskKey: "task1",
},
Expand Down
6 changes: 3 additions & 3 deletions e2e/orchestrator_event_task_complex_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ func testOrchestratorEventTaskComplexData(executionStream pb.Execution_StreamCli

t.Run("create process", func(t *testing.T) {
respProc, err := client.ProcessClient.Create(context.Background(), &pb.CreateProcessRequest{
Key: "event-task-complex-data-process",
Name: "event-task-complex-data-process",
Nodes: []*process.Process_Node{
{
Key: "n0",
Type: &process.Process_Node_Event_{
Event: &process.Process_Node_Event{
Key: "n0",
InstanceHash: instanceHash,
EventKey: "test_event_complex",
},
},
},
{
Key: "n1",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n1",
InstanceHash: instanceHash,
TaskKey: "task_complex",
},
Expand Down
6 changes: 3 additions & 3 deletions e2e/orchestrator_event_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ func testOrchestratorEventTask(executionStream pb.Execution_StreamClient, instan

t.Run("create process", func(t *testing.T) {
respProc, err := client.ProcessClient.Create(context.Background(), &pb.CreateProcessRequest{
Key: "event-task-process",
Name: "event-task-process",
Nodes: []*process.Process_Node{
{
Key: "n0",
Type: &process.Process_Node_Event_{
Event: &process.Process_Node_Event{
Key: "n0",
InstanceHash: instanceHash,
EventKey: "test_event",
},
},
},
{
Key: "n1",
Type: &process.Process_Node_Task_{
Task: &process.Process_Node_Task{
Key: "n1",
InstanceHash: instanceHash,
TaskKey: "task1",
},
Expand Down
Loading