test: Fix rpc_test file
This commit is contained in:
@@ -5,7 +5,7 @@ fn setup() !&redisclient.Redis {
|
||||
mut redis := redisclient.core_get()!
|
||||
// Select db 10 to be away from default one '0'
|
||||
redis.selectdb(10) or { panic(err) }
|
||||
return &redis
|
||||
return redis
|
||||
}
|
||||
|
||||
fn cleanup(mut redis redisclient.Redis) ! {
|
||||
@@ -25,7 +25,8 @@ fn test_rpc() {
|
||||
mut r := redis.rpc_get('testrpc')
|
||||
|
||||
r.call(cmd: 'test.cmd', data: 'this is my data, normally json', wait: false)!
|
||||
returnqueue := r.process(10000, process_test)!
|
||||
|
||||
returnqueue := r.process(process_test, timeout: 10000)!
|
||||
mut res := r.result(10000, returnqueue)!
|
||||
console.print_debug(res)
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ import os
|
||||
import time
|
||||
|
||||
fn test_zinit() {
|
||||
this_dir := os.dir(@FILE)
|
||||
// you need to have zinit in your path to run this test
|
||||
spawn os.execute('zinit -s herolib/osal/zinit/zinit/zinit.sock init -c herolib/osal/zinit/zinit')
|
||||
spawn os.execute('zinit -s ${this_dir}/zinit/zinit.sock init -c ${this_dir}/zinit')
|
||||
time.sleep(time.second)
|
||||
|
||||
client := new_rpc_client('herolib/osal/zinit/zinit/zinit.sock')
|
||||
client := new_rpc_client(socket_path: '${this_dir}/zinit/zinit.sock')
|
||||
|
||||
mut ls := client.list()!
|
||||
mut want_ls := {
|
||||
@@ -57,4 +58,7 @@ fn test_zinit() {
|
||||
time.sleep(time.millisecond * 10)
|
||||
st = client.status('service_1')!
|
||||
assert st.state.contains('SIGTERM')
|
||||
|
||||
// Remove the socet file
|
||||
os.rm('${this_dir}/zinit/zinit.sock')!
|
||||
}
|
||||
|
||||
@@ -185,8 +185,6 @@ clients/livekit
|
||||
'
|
||||
|
||||
tests_error := '
|
||||
osal/package_test.v
|
||||
rpc_test.v
|
||||
screen_test.v
|
||||
tmux_session_test.v
|
||||
tmux_window_test.v
|
||||
|
||||
Reference in New Issue
Block a user