-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix a bug of branchGraph cache with test_case
- Loading branch information
lvcangquan.lcq
committed
Apr 12, 2022
1 parent
9c87a39
commit c291f7e
Showing
19 changed files
with
365 additions
and
2 deletions.
There are no files selected for viewing
Submodule bash-buddy
updated
10 files
+4 −1 | .editorconfig | |
+0 −104 | README.md | |
+1 −1 | bin/.editorconfig | |
+14 −14 | bin/gen_source_guard | |
+54 −194 | lib/common_utils.sh | |
+71 −96 | lib/java_build_utils.sh | |
+177 −316 | lib/prepare_jdks.sh | |
+59 −87 | lib/trap_error_info.sh | |
+0 −87 | templates/appveyor.template.yml | |
+18 −19 | templates/integration_test_template.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/InputCheckOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class InputCheckOp { | ||
public InputCheckOp() { | ||
} | ||
|
||
public Boolean process(int input) { | ||
int compareNumber = 20; | ||
if (input > compareNumber) { | ||
return false; | ||
} else { | ||
return true; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/OnlinePreProcessOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class OnlinePreProcessOp { | ||
public OnlinePreProcessOp() { | ||
} | ||
|
||
public int process(int sqrtResult) { | ||
int addNumber = 2; | ||
int onlineInput = sqrtResult + addNumber; | ||
return onlineInput; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/OnlineSolveOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class OnlineSolveOp { | ||
public OnlineSolveOp() { | ||
} | ||
|
||
public int process(int onlineInput) { | ||
int addNumber = 2; | ||
int onlineResult = onlineInput + addNumber; | ||
return onlineResult; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/PreProcessOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class PreProcessOp { | ||
public PreProcessOp() { | ||
} | ||
|
||
public void process(int input) { | ||
int compareNumber = 10; | ||
if (input < compareNumber) { | ||
System.out.println("input is smaller than 10"); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/RandomOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class RandomOp { | ||
public RandomOp() { | ||
} | ||
|
||
public void process(int result) { | ||
System.out.println("Random process is finished"); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/RayPreProcessOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class RayPreProcessOp { | ||
public RayPreProcessOp () { | ||
} | ||
|
||
public int process(int sqrtResult) { | ||
int addNumber = 100; | ||
int rayInput = sqrtResult + addNumber; | ||
return rayInput; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/RaySolveOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class RaySolveOp { | ||
public RaySolveOp() { | ||
} | ||
|
||
public int process(int rayInput) { | ||
int addNumber = 200; | ||
int rayResult = rayInput + addNumber; | ||
return rayResult; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/ResultCheckOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class ResultCheckOp { | ||
public ResultCheckOp() { | ||
} | ||
|
||
public Boolean process(int result) { | ||
int compareNumber = 10; | ||
if (result < compareNumber) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...est/java/com/allibaba/compileflow/test/om/branch_graph/calculate/ResultPostProcessOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class ResultPostProcessOp { | ||
public ResultPostProcessOp() { | ||
} | ||
|
||
public int process(int result) { | ||
int addNumber = 10; | ||
int finalResult = result + addNumber; | ||
return finalResult; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/RouteOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
import com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo; | ||
import com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum; | ||
|
||
public class RouteOp { | ||
public RouteOp() { | ||
} | ||
|
||
public RouteInfo process(int sqrtResult) { | ||
int compareNumber = 5; | ||
RouteInfo routeInfo = new RouteInfo(); | ||
if (sqrtResult < compareNumber) { | ||
routeInfo.setCalculateType(TypeEnum.ONLINE_SOLVE); | ||
} else { | ||
routeInfo.setCalculateType(TypeEnum.RAY_SOLVE); | ||
} | ||
return routeInfo; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/RouteReadOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
import com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum; | ||
|
||
public class RouteReadOp { | ||
public RouteReadOp() { | ||
} | ||
|
||
public void process(TypeEnum type) { | ||
if (type == TypeEnum.ONLINE_SOLVE || type == TypeEnum.RAY_SOLVE) { | ||
System.out.println("RouteReadOp is processed"); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/SqrtProcessOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
public class SqrtProcessOp { | ||
public SqrtProcessOp() { | ||
} | ||
|
||
public int process(int input) { | ||
try { | ||
double sqrtResult = Math.sqrt(input); | ||
return (int)sqrtResult; | ||
} catch (Exception e) { | ||
System.out.println("SqrtProcessOp is failed"); | ||
return 0; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/com/allibaba/compileflow/test/om/branch_graph/calculate/TypeOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.calculate; | ||
|
||
import com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo; | ||
import com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum; | ||
|
||
public class TypeOp { | ||
public TypeOp() { | ||
} | ||
|
||
public TypeEnum process(RouteInfo routeInfo) { | ||
return routeInfo.getCalculateType(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/java/com/allibaba/compileflow/test/om/branch_graph/common/RouteInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.common; | ||
|
||
import com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum; | ||
|
||
public class RouteInfo { | ||
private TypeEnum calculateType; | ||
|
||
public RouteInfo() { | ||
} | ||
|
||
public void setCalculateType(TypeEnum type) { | ||
calculateType = type; | ||
} | ||
|
||
public TypeEnum getCalculateType() { | ||
return calculateType; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/java/com/allibaba/compileflow/test/om/branch_graph/common/TypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.allibaba.compileflow.test.om.branch_graph.common; | ||
|
||
public enum TypeEnum { | ||
RANDOM, | ||
ONLINE_SOLVE, | ||
RAY_SOLVE; | ||
|
||
private TypeEnum() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bpm code="bpm.BranchGraphTest.bpm" name="test" type="process" description="This is test demo."> | ||
<var name="num" description="入参" dataType="java.lang.Double" inOutType="param"></var> | ||
<var name="numSqrt" description="开根号结果" dataType="java.lang.Double" inOutType="return"></var> | ||
<autoTask id="1649679494823" name="读取路由" g="125,410,90,50"> | ||
<transition to="1649680231918"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RouteReadOp" method="process"> | ||
<var name="type" description="路由类型" dataType="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" contextVarName="typeEnum" inOutType="param"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649681928894" name="Random" g="65,890,90,50"> | ||
<transition to="1649681877600"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RandomOp" method="process"> | ||
<var name="result" description="计算结果" dataType="java.lang.Integer" inOutType="param"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649680235723" name="Online预处理" g="335,620,90,50"> | ||
<transition to="1649681645436"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.OnlinePreProcessOp" method="process"> | ||
<var name="sqrtResult" description="平方根" dataType="java.lang.Integer" contextVarName="sqrtResult" inOutType="param"></var> | ||
<var name="onlineInput" description="online输入" dataType="java.lang.Integer" contextVarName="onlineInput" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649681641648" name="RaySolve" g="125,710,90,50"> | ||
<transition to="1649681814271"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RaySolveOp" method="process"> | ||
<var name="rayInput" description="ray输入" dataType="java.lang.Integer" contextVarName="rayInput" inOutType="param"></var> | ||
<var name="result" description="求解结果" dataType="java.lang.Integer" contextVarName="result" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<decision id="1649681345582" name="判断节点" g="125,570,90,50"> | ||
<transition to="1649680235723" name="否" expression="false"></transition> | ||
<transition to="1649681641648" priority="1" name="是" expression="true"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.TypeOp" method="process"> | ||
<var name="routeInfo" description="路由信息" dataType="com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo" contextVarName="routeInfo" inOutType="param"></var> | ||
<var name="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" description="计算路由" dataType="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" contextVarName="typeEnum" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</decision> | ||
<autoTask id="1649681645436" name="OnlineSolve" g="335,710,90,50"> | ||
<transition to="1649681814271"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.OnlineSolveOp" method="process"> | ||
<var name="onlineInput" description="online输入" dataType="java.lang.Integer" contextVarName="onlineInput" inOutType="param"></var> | ||
<var name="result" description="求解结果" dataType="java.lang.Integer" contextVarName="result" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649674277421" name="预处理" g="220,35,90,50"> | ||
<transition to="1649675887756"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.PreProcessOp" method="process"> | ||
<var name="input" description="input输入" dataType="java.lang.Integer" contextVarName="input" inOutType="param"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649680231918" name="Ray预处理" g="125,490,90,50"> | ||
<transition to="1649681345582"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RayPreProcessOp" method="process"> | ||
<var name="sqrtResult" description="平方根" dataType="java.lang.Integer" contextVarName="sqrtResult" inOutType="param"></var> | ||
<var name="rayInput" description="ray的输入" dataType="java.lang.Integer" contextVarName="rayInput" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649681877600" name="结果后处理" g="235,890,90,50"> | ||
<transition to="11"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.ResultPostProcessOp" method="process"> | ||
<var name="result" description="计算结果" dataType="java.lang.Integer" contextVarName="result" inOutType="param"></var> | ||
<var name="finalResult" description="后处理结果" dataType="java.lang.Integer" contextVarName="finalResult" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<autoTask id="1649679497675" name="读取路由" g="335,410,90,50"> | ||
<transition to="1649680235723"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RouteReadOp" method="process"> | ||
<var name="type" description="路由类型" dataType="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" contextVarName="typeEnum" inOutType="param"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<start id="1" name="开始" g="120,45,30,30"> | ||
<transition to="1649674277421"></transition> | ||
</start> | ||
<end id="11" name="结束" g="545,480,30,30"></end> | ||
<autoTask id="17" name="计算平方根" g="235,150,88,48"> | ||
<transition to="1649677184728"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.SqrtProcessOp" method="process"> | ||
<var name="input" description="input输入" dataType="java.lang.Integer" contextVarName="input" inOutType="param"></var> | ||
<var name="sqrtResult" description="平方根" dataType="java.lang.Integer" contextVarName="sqrtResult" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<decision id="1649681814271" name="判断节点" g="230,790,90,50"> | ||
<transition to="1649681928894" name="否" expression="!resultCheck"></transition> | ||
<transition to="1649681877600" priority="1" name="是" expression="resultCheck"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.ResultCheckOp" method="process"> | ||
<var name="result" description="结果" dataType="java.lang.Integer" contextVarName="result" inOutType="param"></var> | ||
<var name="resultCheck" description="结果检查" dataType="java.lang.Boolean" contextVarName="resultCheck" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</decision> | ||
<autoTask id="1649677184728" name="设置计算路由信息" g="215,235,130,50"> | ||
<transition to="1649678893514"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.RouteOp" method="process"> | ||
<var name="sqrtResult" description="平方根" dataType="java.lang.Integer" contextVarName="sqrtResult" inOutType="param"></var> | ||
<var name="com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo" description="路由信息" dataType="com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo" contextVarName="routeInfo" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
<decision id="1649678893514" name="计算路由" g="235,330,90,50"> | ||
<transition to="1649679494823" priority="1" name="isRay" expression="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum.RAY_SOLVE.equals(typeEnum)"></transition> | ||
<transition to="1649679497675" priority="2" name="isOnline" expression="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum.ONLINE_SOLVE.equals(typeEnum)"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.TypeOp" method="process"> | ||
<var name="routeInfo" description="路由信息" dataType="com.allibaba.compileflow.test.om.branch_graph.common.RouteInfo" contextVarName="routeInfo" inOutType="param"></var> | ||
<var name="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" description="计算路由" dataType="com.allibaba.compileflow.test.om.branch_graph.common.TypeEnum" contextVarName="typeEnum" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</decision> | ||
<autoTask id="1649675887756" name="输入检查" g="370,85,90,50"> | ||
<transition to="11" priority="1" name="否" expression="!inputCheck"></transition> | ||
<transition to="17" name="是" expression="inputCheck"></transition> | ||
<action type="java"> | ||
<actionHandle clazz="com.allibaba.compileflow.test.om.branch_graph.calculate.InputCheckOp" method="process"> | ||
<var name="input" description="input输入" dataType="java.lang.Integer" contextVarName="input" inOutType="param"></var> | ||
<var name="inputCheck" description="输入检查" dataType="java.lang.Boolean" contextVarName="inputCheck" inOutType="return"></var> | ||
</actionHandle> | ||
</action> | ||
</autoTask> | ||
</bpm> |