Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ public Map<String, Object> getBasicDAGInfo(String executionId, boolean brief) {
dagInfo = longTermStorage.getBasicDAGInfo(executionId);
}

if (dagInfo == null) {
throw new IllegalArgumentException("dag is not found");
}

Map<String, Object> result = makeDAGInfoMap(dagInfo, brief);
result.put("context", getContext(executionId, null));
result.put("invoke_summary", tenantTaskStatistic.getFlowAggregate(executionId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ import com.weibo.rill.flow.interfaces.model.task.InvokeTimeInfo
import com.weibo.rill.flow.olympicene.core.model.dag.DAGInfo
import com.weibo.rill.flow.olympicene.core.model.dag.DAGInvokeMsg
import com.weibo.rill.flow.olympicene.core.model.dag.DAGStatus
import com.weibo.rill.flow.service.statistic.TenantTaskStatistic
import com.weibo.rill.flow.service.storage.LongTermStorage
import com.weibo.rill.flow.service.storage.RuntimeStorage
import spock.lang.Specification

class DAGRuntimeFacadeTest extends Specification {
RuntimeStorage runtimeStorage = Mock(RuntimeStorage)
DAGRuntimeFacade dagRuntimeFacade = new DAGRuntimeFacade(runtimeStorage: runtimeStorage)
LongTermStorage longTermStorage = Mock(LongTermStorage)
TenantTaskStatistic tenantTaskStatistic = Mock(TenantTaskStatistic)
DAGRuntimeFacade dagRuntimeFacade = new DAGRuntimeFacade(runtimeStorage: runtimeStorage, longTermStorage: longTermStorage, tenantTaskStatistic: tenantTaskStatistic)

def setup() {
runtimeStorage.clearDAGInfo(*_) >> null
Expand Down Expand Up @@ -89,4 +93,16 @@ class DAGRuntimeFacadeTest extends Specification {
then:
thrown IllegalArgumentException
}

def "test getBasicDAGInfo when DAGInfo does not exist in both storages"() {
given:
runtimeStorage.getBasicDAGInfo("test_execution_id") >> null
longTermStorage.getBasicDAGInfo("test_execution_id") >> null

when:
dagRuntimeFacade.getBasicDAGInfo("test_execution_id", false)

then:
thrown IllegalArgumentException
}
}
Loading