Skip to content

Commit 5119557

Browse files
author
Vyacheslav
authored
Merge pull request hyperledger-indy#780 from Artemkaaas/feature/cli-payment-tests
libnullpay & Cli payment tests
2 parents 6ac7323 + 99e23dc commit 5119557

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3039
-483
lines changed

Jenkinsfile.cd

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,12 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
216216
sh "cp libindy/target/release/libindy.so libnullpay"
217217
dir('libnullpay') {
218218
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
219-
echo "${env_name} Indy Libnullpay Test: Build"
220-
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo build --release"
219+
echo "${env_name} Libindy Test: Build"
220+
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --release --no-run"
221221

222+
echo "${env_name} Libindy Test: Run tests"
223+
sh "LD_LIBRARY_PATH=./ RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release"
224+
222225
if (stashBuildResults) {
223226
stash includes: 'target/release/libnullpay.so', name: 'LibnullpayUbuntuBuildResult'
224227
}
@@ -304,6 +307,17 @@ def windowsTesting() {
304307
"RUST_BACKTRACE=1"
305308
]) {
306309
bat "cargo build --release"
310+
bat "cargo test --release --no-run"
311+
312+
echo "Windows Libnullpay Test: Run tests"
313+
withEnv([
314+
"RUST_TEST_THREADS=1",
315+
"RUST_LOG=indy::=debug,zmq=trace",
316+
"TEST_POOL_IP=$INDY_SDK_SERVER_IP",
317+
"PATH=$WORKSPACE\\libindy\\target\\release;$PATH",
318+
]) {
319+
bat "cargo test --release"
320+
}
307321
}
308322

309323
stash includes: 'target/release/*.dll', name: 'LibnullpayWindowsBuildResult'

Jenkinsfile.ci

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ def windowsTesting() {
6565
"RUST_BACKTRACE=1"
6666
]) {
6767
bat "cargo build"
68+
bat "cargo test --no-run"
69+
70+
echo "Windows Libnullpay Test: Run tests"
71+
withEnv([
72+
"RUST_TEST_THREADS=1",
73+
"RUST_LOG=indy::=debug,zmq=trace",
74+
"TEST_POOL_IP=$INDY_SDK_SERVER_IP",
75+
"PATH=$WORKSPACE\\libindy\\target\\debug;$PATH",
76+
]) {
77+
bat "cargo test"
78+
}
6879
}
6980
}
7081

@@ -255,6 +266,19 @@ def linuxTesting(file, env_name, network_name) {
255266
}
256267
}
257268
},
269+
"${env_name}-libnullpay-test": {
270+
dir('libnullpay') {
271+
testEnv.inside("--network=${network_name}") {
272+
echo "${env_name} Libnullpay Test: Test"
273+
274+
echo "${env_name} Libnullpay Test: Build Test"
275+
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
276+
277+
echo "${env_name} Libnullpay Test: Run tests"
278+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test'
279+
}
280+
}
281+
},
258282
"${env_name}-java-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxJavaTesting) },
259283
"${env_name}-python-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxPythonTesting) },
260284
"${env_name}-cli-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxCLITesting) }

cli/libnullpay.so

18.5 MB
Binary file not shown.

cli/src/commands/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn load_plugin(ctx: &CommandContext, library: &str, initializer: &str) -> Re
121121

122122
match init_func() {
123123
ErrorCode::Success => println_succ!("Plugin has been loaded: \"{}\"", library),
124-
_ => println_err!("Plugin has not been loaded: \"{}\"", library)
124+
_ => return Err(println_err!("Plugin has not been loaded: \"{}\"", library))
125125
}
126126
}
127127

@@ -167,7 +167,6 @@ pub mod tests {
167167
#[cfg(feature = "nullpay_plugin")]
168168
pub fn load_works() {
169169
TestUtils::cleanup_storage();
170-
171170
let ctx = CommandContext::new();
172171

173172
let cmd = load_plugin_command::new();

0 commit comments

Comments
 (0)