Skip to content

Commit

Permalink
add unit test to test submit
Browse files Browse the repository at this point in the history
  • Loading branch information
zeyu10 committed Oct 14, 2024
1 parent 3f9d73f commit 19c31bb
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,35 @@ class InvokeMsgTest extends Specification {
((DAGCallbackInfo) event.getData()).getDagInfo().getTask("A").getTaskInvokeMsg().getOutput() == ['flow_root_execution_id':'bigFlow', 'segments':['gopUrl']]
})
}

def "test submit for debug"() {
given:
String flowYaml = "workspace: default\n" +
"dagName: testSubmit\n" +
"alias: release\n" +
"type: flow\n" +
"inputSchema: '[]'\n" +
"tasks:\n" +
" - next: pass1\n" +
" name: pass0\n" +
" category: pass\n" +
" - next: pass2\n" +
" name: pass1\n" +
" category: pass\n" +
" - name: pass2\n" +
" category: pass\n"
DAG testFlow = dagParser.parse(flowYaml)
dispatcher.dispatch(*_) >> '{"execution_id":"testFlow"}'

when:
olympicene.submit("testFlow", "pass1", testFlow, [:], DAGSettings.DEFAULT, null)

then:
1 * callback.onEvent({Event event ->
event.eventCode == DAGEvent.DAG_SUCCEED.getCode() &&
((DAGCallbackInfo) event.getData()).getDagInfo().getTasks().get("pass0").getTaskStatus() == TaskStatus.SKIPPED &&
((DAGCallbackInfo) event.getData()).getDagInfo().getTasks().get("pass1").getTaskStatus() == TaskStatus.SUCCEED &&
((DAGCallbackInfo) event.getData()).getDagInfo().getTasks().get("pass2").getTaskStatus() == TaskStatus.SKIPPED
})
}
}

0 comments on commit 19c31bb

Please sign in to comment.