Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BIBO (D) [1 BUG, 2 TODOs]
09-25-2020, 01:32 AM
Post: #21
RE: BIBO (D)
(09-24-2020 10:55 PM)lingu Wrote:  
Quote: if $reqcaseid matches $caseid
rename insert.json but don't cover existing file

Just say 'rid --insitu insert.json'
updated headpost in procone.py -- OMUD

(09-24-2020 10:55 PM)lingu Wrote:  
Quote: create empty file insert.json
}
[/code]
It is not a really empty file, is it?

After the match-and-delete, we should generate a result file to report the result of the deletion. If there is no match and no deletion, the result file is a nil file -- a file with zero bytes.
updated in procone.py -- OMUD and added result file design
(( create empty file insert.json -> create file insert.json with request template which has empty value))
Quote this message in a reply
09-25-2020, 01:41 AM
Post: #22
RE: BIBO (D)
(09-24-2020 01:05 PM)zhihao Wrote:  This is disigners' info for cod://prada/procuratorate

delete_case()
Code:
delete_case() {
    clear file $tspfn
    set $reqcaseid as request case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    generate delete success response
}

query_case()
Code:
query_case() {
    clear file $tspfn
    for each case; do
        set option $tycano for procone.py
    done
    generate query result response
}

add "auntie register tasks" for these two function to headpost
(( done -> done
auntie register tasks))
Quote this message in a reply
09-25-2020, 01:54 AM
Post: #23
RE: BIBO (D)
(09-24-2020 10:32 PM)lingu Wrote:  
(09-24-2020 01:05 PM)zhihao Wrote:  delete_case()
Code:
delete_case() {
    clear file $tspfn
    set $reqcaseid as request case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    generate delete success response
}

This is problematic because we give a result '200' before Sage invokes think to run the tasks. It is possible something goes wrong with the delete, but the client receives '200' and think everything is fine. That's a bug.

I am removing the success response.

Then the delete_case function does not return 200, and it is a problem.
Code:
21:40:44 lingu@g1b-2:/home/lingu/forest/prada/prada> make -C procuratorate test
make: Entering directory '/home/lingu/forest/prada/prada/procuratorate'
casecnt before insert: 72
inserting /thinker/storage/soft/bibo/processed/zengxingliang.json
{
"code": 200,
"msg": "ok",
"children": []
}
insert finished

inserted file :/thinker/globe/udata/lingu/testy/procuratorate/tests/typical/73/insert.json
{"type":"insert","query":"","caseid":"","insert":{"keys":[{"key1":"破▒计▒▒信▒系▒","key


casecnt after insert: 73

deleting /thinker/storage/soft/bibo/processed/del_zengxingliang.json
delete finished

file content after deleted
{"type": "","query": "","caseid": "","insert": {"keys": [] }}

make: Leaving directory '/home/lingu/forest/prada/prada/procuratorate'
21:41:06 lingu@g1b-2:/home/lingu/forest/prada/prada>

recorded bug to headpost
Quote this message in a reply
09-25-2020, 02:27 PM
Post: #24
RE: BIBO (D)
正在实现procone.py select功能,调试后发现cmdline命令似乎没有执行。
根据cmdline Ui写了个测试,无输出
Code:
[zhihao@g1b-2 20200914]$ cat test2.py
import sys

sys.path.append("/thinker/local/forest/util/utilib")
import cmdline

#cmdline.runOrExit("cat /thinker/storage/udata/lingu/testy/procuratorate/tests/typical/84/insert.json")
cmdline.runandread("ls")
[zhihao@g1b-2 20200914]$ python test2.py
[zhihao@g1b-2 20200914]$
Quote this message in a reply
09-26-2020, 12:24 PM
Post: #25
RE: prada -- D
(09-25-2020 12:51 AM)zhihao Wrote:  
(09-24-2020 08:26 PM)lingu Wrote:  
(09-24-2020 02:08 PM)zhihao Wrote:  tellThinker() informs think about the request.
Code:
tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert()
        case "delete":
            delete()
        case "query":
            query()
    }
}

There is a 'select' function.
added a 'select' function to tellThinker()

(09-24-2020 08:26 PM)lingu Wrote:  Pls design the 'select' function. You can ask collaborators if you are not sure what 'select' is expected to do.

select function designed as follows:

select_case() {
clear file $tspfn

OK.

Quote: set $reqcaseid as request case id

Pls change to
Code:
$reqcaseid = requested case id

Quote: for each case; do
set option $tycano, $reqtype and $reqcaseid for procone.py
done

Pls change to
Code:
register tasks:
        procone.py --tycano=$tycano --reqtype=$reqtype --reqcaseid=$reqcaseid

Quote: done

getresults()
}
[/code]
RR lingu

OK.
Find all posts by this user
Quote this message in a reply
09-26-2020, 12:34 PM
Post: #26
RE: BIBO (D)
(09-25-2020 02:27 PM)zhihao Wrote:  正在实现procone.py select功能,调试后发现cmdline命令似乎没有执行。
根据cmdline Ui写了个测试,无输出
Code:
[zhihao@g1b-2 20200914]$ cat test2.py
import sys

sys.path.append("/thinker/local/forest/util/utilib")
import cmdline

#cmdline.runOrExit("cat /thinker/storage/udata/lingu/testy/procuratorate/tests/typical/84/insert.json")
cmdline.runandread("ls")
[zhihao@g1b-2 20200914]$ python test2.py
[zhihao@g1b-2 20200914]$

runOrExit does not show stdout and stderr. You can use runread() if you want to get the output. I am documenting some run command functions -- http://tab.d-thinker.org/showthread.php?tid=16267
Find all posts by this user
Quote this message in a reply
09-26-2020, 12:35 PM
Post: #27
RE: BIBO (D)
(09-25-2020 01:54 AM)zhihao Wrote:  
(09-24-2020 10:32 PM)lingu Wrote:  
(09-24-2020 01:05 PM)zhihao Wrote:  delete_case()
Code:
delete_case() {
    clear file $tspfn
    set $reqcaseid as request case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    generate delete success response
}

This is problematic because we give a result '200' before Sage invokes think to run the tasks. It is possible something goes wrong with the delete, but the client receives '200' and think everything is fine. That's a bug.

I am removing the success response.

Then the delete_case function does not return 200, and it is a problem.
Code:
21:40:44 lingu@g1b-2:/home/lingu/forest/prada/prada> make -C procuratorate test
make: Entering directory '/home/lingu/forest/prada/prada/procuratorate'
casecnt before insert: 72
inserting /thinker/storage/soft/bibo/processed/zengxingliang.json
{
"code": 200,
"msg": "ok",
"children": []
}
insert finished

inserted file :/thinker/globe/udata/lingu/testy/procuratorate/tests/typical/73/insert.json
{"type":"insert","query":"","caseid":"","insert":{"keys":[{"key1":"破▒计▒▒信▒系▒","key


casecnt after insert: 73

deleting /thinker/storage/soft/bibo/processed/del_zengxingliang.json
delete finished

file content after deleted
{"type": "","query": "","caseid": "","insert": {"keys": [] }}

make: Leaving directory '/home/lingu/forest/prada/prada/procuratorate'
21:41:06 lingu@g1b-2:/home/lingu/forest/prada/prada>

recorded bug to headpost

I believe I have fixed this problem.
Find all posts by this user
Quote this message in a reply
09-26-2020, 01:49 PM
Post: #28
RE: BIBO (D)
(09-25-2020 12:33 AM)zhihao Wrote:  
(09-24-2020 08:22 PM)lingu Wrote:  
(09-24-2020 07:57 PM)zhihao Wrote:  
(09-24-2020 07:22 PM)lingu Wrote:  
(09-24-2020 06:01 PM)zhihao Wrote:  在cod://prada内添加了Makefile逻辑,添加maketst.sh。目前make test可测试插入删除。

should move it to dir procuratorate. bibo is not prada.

where is the info about the tests?
在cod://prada/procuratorate/ 内创建Makefile和maketest.sh。
Dont make a big test of all tests. Make small tests and combine them.

I think you can rename maketest.sh to be test_crds.sh -- it creates, reads, deletes and selects a case. The create, read, delete and select ops can be individual tests in their own scripts. The crds test invokes them in sequence.
renamed maketest.sh to test_crds.sh and created file "test_delete.sh test_insert.sh test_read.sh test_select.sh" in cod://prada/procuratorate

(09-24-2020 08:22 PM)lingu Wrote:  
Quote:maketest.sh D info:
Code:
show case count before insert
send insert request to trajan.d-thinker.org 20050

output inserted case file
show case count after insert

send delete request to trajan.d-thinker.org 20050

RR lingu

OK as the first version. Make sure to ALWAYS RECORD INFO when designing.

No need to specify D info for tests. Just write OMUD together. Create a thread for that.
created in test_crds.sh -- OMUD

As I said " it creates, reads, deletes and selects a case. The create, read, delete and select ops can be individual tests in their own scripts. The crds test invokes them in sequence." There should be at least 4 programs -- programs for insert, read, delete and crd.

I am creating thread about bibo tests -- http://rar.shufangkeji.com:60380/showthr...p?tid=9167 Pls improve further.
Find all posts by this user
Quote this message in a reply
09-26-2020, 03:34 PM
Post: #29
RE: BIBO (D)
(09-24-2020 01:05 PM)zhihao Wrote:  simpleserv.sh
Code:
监听62818端口,执行talk2thinker.sh

simpleserv still runs the talk2thinker.sh program in ~zhihao This confused me for 2 hours. You should have changed it to run programs in $bibo_base

I am changing it and modifying the headpost.
Find all posts by this user
Quote this message in a reply
09-26-2020, 03:45 PM
Post: #30
RE: BIBO (D)
(09-24-2020 01:05 PM)zhihao Wrote:  getResults() collect returned results from think.
Code:
getresults() {
        scrutinize() {
                generate response for each case
        }
        generate response for all cases
        return response
}

scrutinize() is a bit complex and I am making it a standalone thread -- http://rar.shufangkeji.com:60380/showthr...p?tid=9168
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: