test_indel_zeng inserts and deletes the variant case of zengxingliang
Actually it inserts and deletes. It is in fact a bit tricky because we do not want a delete test to delete a good case if the caseid matches. To avoid problems, i am creating two new cases:
corpus case: zengxingliang-newkey-deletetest.json
caseid "ffbe261c9e6311eabceb005056c00001"
inquiry case: zengxingliang-inquire-deletetest.json
caseid: "ffbe261c9e6311eabceb005056c00001"
Accordingly, i create two new tests:
test_insert_zengx: insert case "ffbe261c9e6311eabceb005056c00001" with zengxingliang-newkey-deletetest.json
test_inquire_zengx: query with new case "ffbe261c9e6311eabceb005056c00001" with zengxiangliang-inquire-deletetest.json
Written by zhihao, test_delete_testcase.sh deletes case "ffbe261c9e6311eabceb005056c00001" specified in del_test_case.json
The test logic flow is:
D info
Code:
t1. test_insert_zengx
t2. test_inquire_zengx -- should be success
t3. test_delete_testcase
t4. test_inquire_zengx -- should fail
---
20210818/lingu: define test programs
20210818/zhihao: add D info
(05-22-2021 11:31 AM)lingu Wrote: [ -> ]test_indel_zeng inserts and deletes the case of zengxingliang
test_indel_zeng.sh:
test_insert_zeng
test_delete_zeng
Actually it inserts and deletes. To make it more modular, I am splitting it into two programs,
It is infact a bit tricky. test_delete may delete a good case if the caseid matches. To avoid problems, i am creating two new cases:
corpus case: zengxingliang-newkey-deletetest.json
caseid "ffbe261c9e6311eabceb005056c00001"
inquiry case: zengxingliang-inquire-deletetest.json
caseid: "ffbe261c9e6311eabceb005056c00001"
Accordingly, i create two new tests:
test_insert_zengx: insert case "ffbe261c9e6311eabceb005056c00001" with zengxingliang-newkey-deletetest.json
test_inquire_zengx: query with new case "ffbe261c9e6311eabceb005056c00001" with zengxiangliang-inquire-deletetest.json
i will also modify your test program test_delete_testcase.sh to delete case "ffbe261c9e6311eabceb005056c00001" by modifying del_test_case.json
The test logic flow is:
t1. test_insert_zengx
t2. test_inquire_zengx -- should be success
t3. test_delete_testcase
t4. test_inquire_zengx -- should fail
RR zhihao
(08-18-2021 07:53 PM)lingu Wrote: [ -> ] (05-22-2021 11:31 AM)lingu Wrote: [ -> ]test_indel_zeng inserts and deletes the case of zengxingliang
test_indel_zeng.sh:
test_insert_zeng
test_delete_zeng
Actually it inserts and deletes. To make it more modular, I am splitting it into two programs,
It is infact a bit tricky. test_delete may delete a good case if the caseid matches. To avoid problems, i am creating two new cases:
corpus case: zengxingliang-newkey-deletetest.json
caseid "ffbe261c9e6311eabceb005056c00001"
inquiry case: zengxingliang-inquire-deletetest.json
caseid: "ffbe261c9e6311eabceb005056c00001"
Accordingly, i create two new tests:
test_insert_zengx: insert case "ffbe261c9e6311eabceb005056c00001" with zengxingliang-newkey-deletetest.json
test_inquire_zengx: query with new case "ffbe261c9e6311eabceb005056c00001" with zengxiangliang-inquire-deletetest.json
i will also modify your test program test_delete_testcase.sh to delete case "ffbe261c9e6311eabceb005056c00001" by modifying del_test_case.json
The test logic flow is:
t1. test_insert_zengx
t2. test_inquire_zengx -- should be success
t3. test_delete_testcase
t4. test_inquire_zengx -- should fail
RR zhihao
good to me, and it will be better if the content is unique, then the web system will not show the test case.
I don't see these new tests, are them pushed?
update to headpost:
---
D info
Code:
t1. test_insert_zengx
t2. test_inquire_zengx -- should be success
t3. test_delete_testcase
t4. test_inquire_zengx -- should fail
(08-18-2021 08:44 PM)zhihao Wrote: [ -> ]good to me, and it will be better if the content is unique, then the web system will not show the test case.
I don't see these new tests, are them pushed?
i have not programmed them, yet.
Quote:update to headpost:
---
D info
Code:
t1. test_insert_zengx
t2. test_inquire_zengx -- should be success
t3. test_delete_testcase
t4. test_inquire_zengx -- should fail
I am glad you are updating the headpost, but you need define the test programs before using them. You omitted quite some lines in my test and this makes the definition unclear. I am adding the defining text to the headpost.
The test is half baked, still not working. But I pushed the code anyway.
Code:
[sage@limbo305-1 test]$ make test cases=indel_zeng
Testing indel_zeng
run test ./test_indel_zeng.sh
sending insert request ./processed/zengxingliang-newkey-deletetest.json
return code: 200
insert success
sending delete request /thinker/local/soft/bibo/app/test/processed/del_test_case.json to localhost:62818
return code:
delete FAILED
make: *** [Makefile:22: test] Error 255
[sage@limbo305-1 test]$
test_indel_zeng is able to give reasonable results on limbo305
Code:
[sage@limbo305-1 test]$ make test cases=indel_zeng
...
"caseid": "ffbe261c9e6311eabceb005056c00001",
"caseyear": 2017,
"casetitle": "曾兴亮、王玉生破坏计算机信息系统案",
"casetype": "最高人民检察院指导性案例",
"caserate": "5.00",
"caseaction": "破坏计算机信息系统罪",
"score": 100
}
]
}
return code: 200
inquire success
sending delete request /thinker/local/soft/bibo/app/test/processed/del_test_case.json to localhost:62818
return code: 200
delete SUCCESS
sending inquire request ./processed/zengxingliang-inquire-deletetest.json to localhost:62818
{
"code": 404,
"msg": "not found",
"children": [
]
}
return code: 404
inquire failed
found deleted case. Fail.
make: *** [Makefile:22: test] Error 255
[sage@limbo305-1 test]$