首文添加 test_inquire_shen.sh:
test_inquire_shen.sh: 用于测试处理20288个字符的查询请求时,是否会出现没有返回值的情况
(10-11-2020 08:49 PM)zhihao Wrote: [ -> ]首文添加 test_inquire_shen.sh:
test_inquire_shen.sh: 用于测试处理20288个字符的查询请求时,是否会出现没有返回值的情况
triage()用jq获得casetype,但似乎jq处理相关网络请求json报错。
Code:
[sage@limbo30-1 typical]$ cp ../newcase/newcase.txt /thinker/net/udata/all/
[sage@limbo30-1 typical]$ jq '.type' /thinker/net/udata/all/newcase.txt
parse error: Invalid numeric literal at line 1, column 6197
[sage@limbo30-1 typical]$
但处理该json原始文件不报错。
Code:
[sage@limbo30-1 typical]$ jq '.type' /thinker/globe/soft/bibo/app/test/processed/query_shenmou.json
"query"
[sage@limbo30-1 typical]$
两个文件不同。
Code:
[sage@limbo30-1 typical]$ ll /thinker/globe/soft/bibo/app/test/processed/query_shenmou.json
-rw-rw-r-- 1 sage lingu 29771 Oct 11 21:52 /thinker/globe/soft/bibo/app/test/processed/query_shenmou.json
[sage@limbo30-1 typical]$ ll /thinker/net/udata/all/newcase.txt
-rw-rw-r-- 1 sage sage 29746 Oct 11 23:31 /thinker/net/udata/all/newcase.txt
[sage@limbo30-1 typical]$
看2文件开头没有什么不同。
Code:
[sage@limbo30-1 typical]$ od -c /thinker/net/udata/all/newcase.txt |head
0000000 { " t y p e " : " q u e r y " ,
0000020 " q u e r y " : " 344 270 212 346 265 267 345
0000040 270 202 346 237 220 345 214 272 344 272 272 346 260 221 346 243
0000060 200 345 257 237 351 231 242 345 205 254 350 257 211 346 241 210
0000100 344 273 266 345 256 241 346 237 245 346 212 245 345 221 212 346
0000120 224 266 346 241 210 346 227 266 351 227 264 357 274 232 2 0
0000140 1 9 345 271 264 7 346 234 210 3 0 346 227 245 344 276
0000160 246 346 237 245 346 234 272 345 205 263 357 274 232 344 270 212
0000200 346 265 267 345 270 202 345 205 254 345 256 211 345 261 200 346
0000220 237 220 345 210 206 345 261 200 347 247 273 351 200 201 345 215
[sage@limbo30-1 typical]$ od -c /thinker/globe/soft/bibo/app/test/processed/query_shenmou.json |head
0000000 { " t y p e " : " q u e r y " ,
0000020 " q u e r y " : " 344 270 212 346 265 267 345
0000040 270 202 346 237 220 345 214 272 344 272 272 346 260 221 346 243
0000060 200 345 257 237 351 231 242 345 205 254 350 257 211 346 241 210
0000100 344 273 266 345 256 241 346 237 245 346 212 245 345 221 212 346
0000120 224 266 346 241 210 346 227 266 351 227 264 357 274 232 2 0
0000140 1 9 345 271 264 7 346 234 210 3 0 346 227 245 344 276
0000160 246 346 237 245 346 234 272 345 205 263 357 274 232 344 270 212
0000200 346 265 267 345 270 202 345 205 254 345 256 211 345 261 200 346
0000220 237 220 345 210 206 345 261 200 347 247 273 351 200 201 345 215
把二者全部od出来,发现差异在有 A z " 的地方开始。
Code:
742 od -c /thinker/net/udata/all/newcase.txt > /tmp/newcase.od
743 od -c /thinker/globe/soft/bibo/app/test/processed/query_shenmou.json > /tmp/shen.od
744 diff /tmp/newcase.od /tmp/shen.od
'make test' was successful even though some tests failed. This is a bug.
Code:
./test_inquire.sh
sending inquire request ./processed/chendengchang-with-blank-line.json
return code: 200
inquire success
./test_crds.sh
casecnt before insert: 5
sending insert request: /thinker/storage/soft/bibo/processed/zengxingliang.json
cat: /thinker/storage/soft/bibo/processed/zengxingliang.json: No such file or directory
run1 exits with 0 for (cat /thinker/storage/soft/bibo/processed/zengxingliang.json; sleep 10 ) | ncat trajan.d-thinker.org 20050
insert finished
ls: cannot access '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical': No such file or directory
inserted json case stores in:/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json
inserted json case:
head: cannot open '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json' for reading: No such file or directory
...
tail: cannot open '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json' for reading: No such file or directory
casecnt after insert: 5
sending delete request: /thinker/storage/soft/bibo/processed/del_zengxingliang.json
cat: /thinker/storage/soft/bibo/processed/del_zengxingliang.json: No such file or directory
run1 exits with 0 for ( cat /thinker/storage/soft/bibo/processed/del_zengxingliang.json; sleep 10 ) | ncat trajan.d-thinker.org 20050
delete finished
case content after deleted
cat: /thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json: No such file or directory
make[1]: Leaving directory '/tmp/root_install1_workdir/bibo/bibo/app/test'
/tmp/root_install1_workdir/bibo
[Mon Oct 12 03:26:07 CST 2020] install1 /thinker/local/shed/installation/limbo30-tc/bibo.tar.gz ... OK
Zhihao - pls fix this issue.
(09-26-2020 01:49 PM)lingu Wrote: [ -> ]test_select.sh:
Code:
casefile=sel_zengxingliang.json
flog_also_stderr=True
ret = send select request $casefile to $bibo_server_addr $bibo_server_port
if ($ret == 200) {
flog "select success"
return 0
}
else {
flog "select failed"
return 99
}
the pseudocode just selects a case, but the real code does insert and delete as well. I am commenting out the insert and delete logic. If we need insert and delete, we can simply run a combined test with tests insert, select and delete.
(09-26-2020 01:49 PM)lingu Wrote: [ -> ]test_delete.sh:
Code:
casefile=del_zengxingliang.json
flog_also_stderr=True
ret = send delete request $casefile to $bibo_server_addr $bibo_server_port
if ($ret == 200) {
flog "delete success"
return 0
}
else {
flog "delete failed"
return 99
}
Actually it inserts and deletes. To make it more modular, I am splitting it into two programs, test_delete_zeng and test_indel_zeng.
Also I am splitting them into separate threads.
(11-30-2020 05:19 PM)lingu Wrote: [ -> ] (10-12-2020 04:27 AM)lingu Wrote: [ -> ]'make test' was successful even though some tests failed. This is a bug.
Code:
./test_inquire.sh
sending inquire request ./processed/chendengchang-with-blank-line.json
return code: 200
inquire success
./test_crds.sh
casecnt before insert: 5
sending insert request: /thinker/storage/soft/bibo/processed/zengxingliang.json
cat: /thinker/storage/soft/bibo/processed/zengxingliang.json: No such file or directory
run1 exits with 0 for (cat /thinker/storage/soft/bibo/processed/zengxingliang.json; sleep 10 ) | ncat trajan.d-thinker.org 20050
insert finished
ls: cannot access '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical': No such file or directory
inserted json case stores in:/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json
inserted json case:
head: cannot open '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json' for reading: No such file or directory
...
tail: cannot open '/thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json' for reading: No such file or directory
casecnt after insert: 5
sending delete request: /thinker/storage/soft/bibo/processed/del_zengxingliang.json
cat: /thinker/storage/soft/bibo/processed/del_zengxingliang.json: No such file or directory
run1 exits with 0 for ( cat /thinker/storage/soft/bibo/processed/del_zengxingliang.json; sleep 10 ) | ncat trajan.d-thinker.org 20050
delete finished
case content after deleted
cat: /thinker/globe/udata/lingu/testy/procuratorate/tests/typical//insert.json: No such file or directory
make[1]: Leaving directory '/tmp/root_install1_workdir/bibo/bibo/app/test'
/tmp/root_install1_workdir/bibo
[Mon Oct 12 03:26:07 CST 2020] install1 /thinker/local/shed/installation/limbo30-tc/bibo.tar.gz ... OK
Zhihao - pls fix this issue.
?
I am fixing insert, inquire, select, delete tests.
to avoid delete real case in mistake, use test case to test operation, add to headpost:
---
test_insert_testcase.sh: insert test_case.json which has caseid:"aaaaa..." and casetitle: "计算机案例"
test_delete_testcase.sh: request to delete case with caseid "aaaaa..."
---