start time和end time本身就在index.html文件里。
而下方的类似聚合报告在哪里呢?通过Linux命令检索:find .
|xargs grep -iR
"statisticsTable",看到是在js文件里存储的数据。
使用shell命令提取文件数据,使用shell将结果插入数据库中。
dir=${WORKSPACE}/test_report
startTime=`grep "Start Time:" -A1 $dir/index.html|tail -n
1|awk -F'"' '{print $2}'`
endTime=`grep "End Time:" -A1 $dir/index.html|tail -n 1|awk
-F'"' '{print $2}'`
resLine=`grep "statisticsTable"
$dir/content/js/dashboard.js`
resLine=`echo ${resLine#*,}`
resLine=`echo ${resLine%, function*}`
label=`echo $resLine|jq .items[0].data[0]|tr -d '"'`
samples=`echo $resLine|jq .items[0].data[1]`