Skip to content

Commit

Permalink
add doc test first example
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Mar 31, 2020
1 parent c29d0df commit 0eedece
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/BERT_10_MINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tools/doc_test.sh
Original file line number Diff line number Diff line change
@@ -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 $@
3 changes: 2 additions & 1 deletion tools/doc_tester_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 0eedece

Please sign in to comment.