Skip to content

Commit 657c992

Browse files
authored
<fix>(CI): add sm scene CI. (#754)
1 parent fed32fd commit 657c992

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

.ci/ci_check.sh

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,22 @@ prepare_environment()
7171
cp -r src/test/resources/ecdsa/abi src/integration-test/resources/abi
7272
cp -r src/test/resources/ecdsa/bin src/integration-test/resources/bin
7373

74-
# sed_cmd=$(get_sed_cmd)
75-
# local node_type="${1}"
76-
# if [ "${node_type}" == "sm" ];then
77-
# rm -rf src/integration-test/resources/abi
78-
# rm -rf src/integration-test/resources/bin
79-
# cp -r src/test/resources/gm/abi src/integration-test/resources/abi
80-
# cp -r src/test/resources/gm/bin src/integration-test/resources/bin
81-
# ${sed_cmd} 's/useSMCrypto = "false"/useSMCrypto = "true"/g' src/integration-test/resources/config.toml
82-
# fi
74+
sed_cmd=$(get_sed_cmd)
75+
local node_type="${1}"
76+
local use_sm="false"
77+
local not_use_sm="true"
78+
if [ "${node_type}" == "sm" ];then
79+
use_sm="true"
80+
not_use_sm="false"
81+
rm -rf src/integration-test/resources/abi
82+
rm -rf src/integration-test/resources/bin
83+
cp -r src/test/resources/gm/abi src/integration-test/resources/abi
84+
cp -r src/test/resources/gm/bin src/integration-test/resources/bin
85+
fi
86+
use_sm_str="useSMCrypto = \"${use_sm}\""
87+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/config.toml
88+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/amop/config-subscriber-for-test.toml
89+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/amop/config-publisher-for-test.toml
8390
}
8491

8592
prepare_wasm_environment()
@@ -120,8 +127,9 @@ clean_node()
120127
# check integration-test for non-gm node
121128
check_standard_node()
122129
{
123-
build_node "normal" "${2}"
124-
prepare_environment
130+
rm -rf build dist
131+
build_node "normal" "${3}"
132+
prepare_environment "${2}"
125133
## run integration test
126134
bash gradlew clean integrationTest --info
127135
## clean
@@ -130,7 +138,8 @@ check_standard_node()
130138

131139
check_wasm_node()
132140
{
133-
build_node "wasm" "${2}"
141+
rm -rf build dist
142+
build_node "wasm" "${3}"
134143
prepare_wasm_environment
135144
## run integration test
136145
bash gradlew clean integrationWasmTest --info
@@ -146,7 +155,7 @@ LOG_INFO "------ download_build_chain: v3.2.0---------"
146155
download_binary "v3.2.0"
147156
download_build_chain "v3.2.0"
148157
LOG_INFO "------ check_standard_node---------"
149-
check_standard_node "false"
158+
check_standard_node "false" "sm" "-s"
150159
LOG_INFO "------ check_wasm_node---------"
151160
check_wasm_node "true"
152161
LOG_INFO "------ check_basic---------"

src/integration-test/resources/amop/config-publisher-for-test.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[cryptoMaterial]
44
certPath = "conf"
5+
useSMCrypto = "false"
56
# CA cert file path
67
# caCert = "conf/ca.crt"
78
# SSL cert file path

src/integration-test/resources/amop/config-subscriber-for-test.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[cryptoMaterial]
44
certPath = "conf"
5+
useSMCrypto = "false"
56
# CA cert file path
67
# caCert = "conf/ca.crt"
78
# SSL cert file path

src/integration-wasm-test/java/org/fisco/bcos/sdk/v3/test/wasm/transaction/decoder/ScaleCodecTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
public class ScaleCodecTest {
1515
private static final String configFile =
16-
"src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
16+
"src/integration-wasm-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
1717

1818
@Test
1919
public void testNumericType() throws Exception {

src/integration-wasm-test/java/org/fisco/bcos/sdk/v3/test/wasm/transaction/functionCodec/CodecComplexTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public class CodecComplexTest {
2424
private static final String CONFIG_FILE =
25-
"src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
25+
"src/integration-wasm-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
2626
private final Client client;
2727

2828
public CodecComplexTest() {

src/integration-wasm-test/java/org/fisco/bcos/sdk/v3/test/wasm/transaction/functionCodec/CodecTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
public class CodecTest {
1919
private static final String configFile =
20-
"src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
20+
"src/integration-wasm-test/resources/" + ConstantConfig.CONFIG_FILE_NAME;
2121

2222
@Test
2323
public void testNumericType() throws Exception {

0 commit comments

Comments
 (0)