• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 性能測試工具-MysqlBench(2)

    發表于:2012-10-31來源:百度質量部作者:不詳點擊數: 標簽:性能測試工具
    如何使用 你只需要根據規定的文件格式組織SQL命令和預期結果,通過php AutoSQL.php command.sql expect.result就可以自動化執行SQL命令,并與預期結果校驗。 命令

      如何使用

      你只需要根據規定的文件格式組織SQL命令和預期結果,通過php AutoSQL.php command.sql expect.result就可以自動化執行SQL命令,并與預期結果校驗。

      命令格式

      通過php AutoSQL.php -h 可以獲知AutoSQL工具可以支持的命令列表,如下:

      php AutoSQL.php [command]

      command:

      -h print this usage

      query_file expect_file

      query_file store sql command, file pattern: case_name##sql command##

      expect_file store expected result of query, file pattern: case_name##query fail or not##[NOCHECK##]effect rows[##ORDER(result order)]##false(insert,update,delete,replace) or result num(select)##row1##row2##…##

      -r [-d pathname]: run cases in the path, default is current directory.

      -c [-d logpath]: check run result from log files, default is log directory in current directory

      如上所述,具體說明如下:

      1. 執行單個文件:php AutoSQL.php query_file expect_file,文件格式見下文

      2. 執行某個文件夾下的所有command文件:php AutoSQL.php -r -d pathname,支持絕對路徑和相對路徑,默認為當前路徑

      3. 批量查看case是否執行成功:php AutoSQL.php -c -d logpath,指定logs目錄,自動化工具會列出所有fail的test suite和case,并展示在前臺,默認為當前路徑下的log目錄

      文件格式

      query_file

      query_file的格式如下:

      case_name##sql command##

      各個參數說明如下:

      case_name: case名

      sql command:sql命令,sql command的命令格式與mysql官方規定的一致。

      例子:

      case0##delete from singleC;##

      case1##insert singleC (cID) values (30000), (30001);##

      case2##select * from singleC;##

      首先case0清空singleC表,然后case1插入兩條記錄,然后case2查詢表singleC,確認記錄是否插入成功

      expect_file

      expect_file的格式如下:

      case_name##query fail or not##[NOCHECK##]effect rows[##ORDER(result order)]##false(insert, update,delete,replace) or result num(select)##row1##row2##…##

      各個參數說明如下:

      case_name:case名,與query_file中的case_name一一對應

      query fail or not:命令預期執行失敗與否

      NOCHECK:該選項指明只需判斷query是否正常,不判斷結果

      effect rows:insert、delete、update、replace操作時受影響的行數,select操作時effect rows為-1

      ORDER(result order):該選項只適合于select操作,配置為ORDER時,select結果要求與預期的結果完全一致,包括順序。不指定ORDER時,select結果與預期結果內容一致即可,順序不考慮。

      false(insert,update,delete,replace) or result num(select):select操作時為返回的結果行數,insert、update、delete、replace時為false

      row1##row2##…##:每行的預期內容,一行中每個字段以逗號(,)分隔。

      例子:

      case0##true##NOCHECK##

      case1##true##2##false##

      case2##true##-1##2##30000,,,vincent,100##30001,,,vincent,100##

      case0帶NOCHECK,僅判斷query是否成功,case1插入兩條記錄的作用是effected rows為2,case2查詢出2兩條記錄,為case1插入的記錄

      幫助

      mail:qablog@baidu.com

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>