From 226b464c9958cbdb5b2383554784cada01510e49 Mon Sep 17 00:00:00 2001 From: wangjiawei04 Date: Tue, 31 Mar 2020 04:50:19 +0000 Subject: [PATCH] add doc test first example --- doc/BERT_10_MINS.md | 3 ++- tools/doc_test.sh | 10 ++++++++++ tools/doc_tester_reader.py | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tools/doc_test.sh diff --git a/doc/BERT_10_MINS.md b/doc/BERT_10_MINS.md index e5faed74..e668b320 100644 --- a/doc/BERT_10_MINS.md +++ b/doc/BERT_10_MINS.md @@ -95,7 +95,8 @@ sh pip_app.sh python bert_10.py sh server.sh & wget https://paddle-serving.bj.bcebos.com/bert_example/data-c.txt --no-check-certificate -cat data-c.txt | python bert_client.py +head -n 500 data-c.txt > data.txt +cat data.txt | python bert_client.py if [[ $? -eq 0 ]]; then echo "test success" else diff --git a/tools/doc_test.sh b/tools/doc_test.sh new file mode 100644 index 00000000..c76656bc --- /dev/null +++ b/tools/doc_test.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + + +function main() { + cat Serving/doc/doc_test_list | xargs python Serving/tools/doc_tester_reader.py Serving/doc/ + +} + + +main $@ diff --git a/tools/doc_tester_reader.py b/tools/doc_tester_reader.py index c2cf0fdc..07816e70 100644 --- a/tools/doc_tester_reader.py +++ b/tools/doc_tester_reader.py @@ -58,7 +58,8 @@ def GetTestFile(lines, i, filename): def RunTest(): folder = 'test' os.system('cd ' + folder + ' && sh start.sh') + os.system('cd .. && rm -rf ' + folder) if __name__ == '__main__': - ReadMarkDown(sys.argv[1]) + ReadMarkDown(os.path.join(sys.argv[1], sys.argv[2])) RunTest() -- GitLab