UI測試後生成測試報告,利用shell腳本上傳svn
阿新 • • 發佈:2018-05-18
clas use svn add 就刪除 let pwd IT autoconf sdfsdf
ui測試後生成測試報告,把報告保存在某一個固定路徑
shell腳本把這個報告上傳
#!/bin/bash -ile #svn下載文件 #svn checkout http://svn.xxx.com/svn/xxxx/trunk/UI/report --username xxx --password dsdfsdf; svn checkout http://svn.xxx.com.cn/svn/xxxx/trunk/UI/report cd report pwd #是否存在report 文件,如果存在就刪除,這樣svn上就不會保存很多文件,只保存一個文件 files=$(ls report*.html 2> /dev/null | wc -l) if [ $files != "0" ] ;then #存在文件就刪除 echo "文件存在" svn delete report*.html svn commit -m "delete report" else echo "文件不存在" fi #獲取報告文件存放id flag=`cat /Users/pub_pawf_autotest/autoconf/flag.txt` echo $flag #生成報告文件的路徑 reportPath="/Users/pub_pawf_autotest/autoconf/report/report"$flag".html" #生成的報告文件名 addReportPath=report"$flag".html echo $reportPath #如果生成的報告文件存在,就上傳svn 判斷文件是否存在 if [ -f $reportPath ] ; then echo "報告文件存在"$reportPath cp $reportPath . svn add $addReportPath svn commit -m "add report"$addFilePath else echo "報告文件不存在"$reportPathfi cd .. rm -rf report #重新下載下上傳報告的svn文件 svn checkout http://svn.xxx.com/svn/xxx/trunk/UI/report
UI測試後生成測試報告,利用shell腳本上傳svn