乐趣区

关于数据库:MatrixOne从入门到实践07MOTester

MatrixOne 从入门到实际——MO-Tester

从 0.5.0 版本开始,MatrixOne 引入了一个自动测试框架 MO-Tester。

MO-Tester 测试框架,也能够称作为测试器,是通过 SQL 测试 MatrixOne 或其余数据库性能的。

简介

MO-Tester 是基于 Java 语言进行开发,用于 MatrixOne 的测试套件。MO-Tester 构建了一整套残缺的工具链来进行 SQL 自动测试。它蕴含测试用例和运行后果。MO-Tester 启动后,MO-Tester 将应用 MatrixOne 运行所有 SQL 测试用例,并将所有输入 SQL 测试后果与预期后果进行比拟。所有案例的后果无论胜利或者失败,都将记录在报告中。

MO-Tester 相干用例、后果和报告的链接如下:

  • Cases: https://github.com/matrixorig…
  • Result: https://github.com/matrixorig…
  • Report: 运行完结后,本地目录主动生成 mo-tester/report

测试用例和测试后果一一对应。如需增加新的测试用例和测试后果请进入右侧所示 MatrixOne 仓库门路中进行增加:https://github.com/matrixorig…

MO-Tester 测试用例如下表所示:

测试用例 形容
Benchmark/TPCH DDL and 22 Queries of TPCH Benchmark
Database DDL Statements, creation/drop databases
Table DDL Statements, creation/drop tables
DML DML Statements, including insert, select, show statements
dtype Data Types and type conversion test cases
Expression Case when, With(CTE), Temporal Interval
Function Aggregate function, built-in function
Explain Explain statement
Join Join statement, including Left/Right/Inner/Outer/Natural Join
Operator Including +,-,*,/,MOD,%,=, >, <, IS, LIKE etc
Subquery Including Select/From/Where subquery
Transaction Test of isolation level, atomicity

应用 MO-Tester

环境筹备

  • 装置 jdk 8

    # 下载 jdk 压缩包
    下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 
    下载版本为 java 8 的:jdk-8u131-linux-x64.tar.gz
    # 解压
    tar -zxf jdk-8u131-linux-x64.tar.gz
    # 解压后 的目录假如为
    /home/java/jdk1.8.0_131
    # 编辑 /etc/profile,文件的开端增加
    export JAVA_HOME=/home/java/jdk1.8.0_131
    export PATH=$PATH:$JAVA_HOME/bin
    # 刷新 profile 
    source /etc/profile
    # 验证 jdk
    [root@motest java]# java -version
    java version "1.8.0_131"
    Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
  • 启动 MatrixOne

    请参考[MatrixOne 部署]()

  • 克隆 MO-Tester 仓库

    git clone https://github.com/matrixorigin/mo-tester.git

配置 MO-Tester

MO-tester 基于 Java 语言进行开发,因而 Mo-tester 所依赖的 Java 数据库连贯(JDBC,Java Database Connectivity)驱动程序须要配置 mo.yml 文件里的参数信息:进入到 mo-tester 本地仓库,关上 mo.yml 文件,配置服务器地址、默认的数据库名称、用户名和明码等。

以下是本地独立版本 MatrixOne 的默认示例。


#jdbc
jdbc:
  driver: "com.mysql.cj.jdbc.Driver"
  server:
  - addr: "127.0.0.1:6001"
  #- addr: "127.0.0.1:3306"
  #- addr: "127.0.0.1:3306"
  database:
    default: ""
  paremeter:
    characterSetResults: "utf8"
    continueBatchOnError: "false"
    useServerPrepStmts: "true"
    alwaysSendSetIsolation: "false"
    useLocalSessionState: "true"
    zeroDateTimeBehavior: "CONVERT_TO_NULL"
    failoverReadOnly: "false"
    serverTimezone: "Asia/Shanghai"
    socketTimeout: 30000
#users
user:
  name: "dump"
  password: "111"

运行 MO-Tester

运行以下所示命令行,SQL 所有测试用例将主动运行,并将报告和谬误音讯生成至 report/report.txtreport/error.txt 文件中。

./run.sh

如果你想调整测试范畴,你能够批改 run.yml 文件中的 path 参数。或者,在执行 run.sh 命令时,你也能够指定一些参数,参数解释如下:

参数 参数定义
-p 设置由 MO-tester 执行的测试用例的门路。默认值能够参见 run.yml 文件中 path 的配置参数
-m 设置 MO-tester 测试的办法,即间接运行或者生成新的测试后果。默认值能够参见 run.yaml 文件中 method 的配置参数
-t 设置 MO-tester 执行 SQL 命令的格局类型。默认值能够参见 run.yml 文件中 type 的配置参数。
-r 设置测试用例应该达到的成功率。默认值能够参见 run.yml 文件中 rate 的配置参数。
-i 设置蕴含列表,只有门路中名称蕴含其中一个列表的脚本文件将被执行,如果有多个,如果没有指定,用 ’,’ 分隔,指的是蕴含的所有状况 set the including list, and only script files in the path whose name contains one of the lists will be executed, if more than one, separated by ,, if not specified, refers to all cases included
-e 设置排除列表,如果门路下的脚本文件的名称蕴含一个排除列表,则不会被执行,如果有多个,用 ’,’ 分隔,如果没有指定,示意不排除任何状况 set the excluding list, and script files in the path whose name contains one of the lists will not be executed, if more than one, separated by ,, if not specified, refers to none of the cases excluded
-g 示意带有 [– @bvt:issue#{issueNO.}] 标记的 SQL 命令将不会被执行,该标记以 [– @bvt:issue#{issueNO.}]开始,以 [– @bvt:issue]完结。例如,— @bvt:issue#3236 select date_add(“1997-12-31 23:59:59”,INTERVAL “-10000:1” HOUR_MINUTE); select date_add(“1997-12-31 23:59:59”,INTERVAL “-100 1” YEAR_MONTH); — @bvt:issue 这两个 SQL 命令与问题 #3236 相关联,它们将不会在 MO-tester 测试中执行,直到问题 #3236 修复后标签移除才能够在测试中执行。
-n 示意在比拟后果时将疏忽后果集的元数据

run.yml:

#test scritps path
path: "cases/"

#method
#run: means execute test scripts configured by para[path] completely,and generate the test reprot,execution logs
#debug: means execute  test scripts configured by para[path] completely, only print the result to console,do not generate the test reprot,execution logs
#genrs: means generate the expected result for the test scripts only
method: "run"

#rate: means the execution success rate,if the actual rate is less than this,the programe will exit with status 1
rate: 100

示例:

./run.sh -p case -m run -t script -r 100 -i select,subquery -e substring -g

应用 MO-Tester 实现 TPCH

留神: 这里的 tpch 只是一个测试用例,仅用来测试数据库可能跑通 tpch 的 22 条查问语句,蕴含的数据条数较少。

  • 获取 MatrixOne 源码

    git clone https://github.com/matrixorigin/matrixone.git
  • 复制 test 目录到 MO-Tester

    cp -r matrixone/test/cases/benchmark /home/motest/mo-tester/cases
    # 复制后,能够在 MO-Tester 中看到相干 case 如下所示:root@motest cases]# pwd
    /home/motest/mo-tester/cases
    [root@motest cases]# cd benchmark/
    [root@motest benchmark]# ll
    total 0
    drwxr-xr-x. 6 root root 71 Oct  1 09:06 tpch
    [root@motest benchmark]# pwd
    /home/motest/mo-tester/cases/benchmark

    同理,将 MatrixOne 源码目录中 test 下的 result 也复制过去

    cp -r matrixone/test/result/benchmark /home/motest/mo-tester/result
  • 运行 MO-Tester 进行 TPCH 测试

    ./run.sh -p ./cases/benchmark/tpch -m run -t script -r 100

    最终结果显示:

    The path of the cases that need to be executed by mo-tester  : ./cases/benchmark/tpch
    The method that mo-tester will run with :run
    The type of the format that mo-tester execute the sqlcommand in : script
    The success rate that test cases should reach : 100
    2022-10-01 09:18:23 INFO  Tester:134 - The method is [run],now start to run the scripts in the path[./cases/benchmark/tpch].
    2022-10-01 09:18:23 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/01_DDL/01_create_table.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:23 INFO  Executor:186 - The script file[./cases/benchmark/tpch/01_DDL/01_create_table.sql] has been executed, and cost: 0.02s, total:11, success:11, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:23 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/02_insert_customer.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:23 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/02_insert_customer.sql] has been executed, and cost: 0.032s, total:16, success:16, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:23 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/03_insert_lineitem.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:25 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/03_insert_lineitem.sql] has been executed, and cost: 1.584s, total:602, success:602, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:25 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/04_insert_nation.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:25 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/04_insert_nation.sql] has been executed, and cost: 0.008s, total:4, success:4, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:25 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/05_insert_orders.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:25 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/05_insert_orders.sql] has been executed, and cost: 0.288s, total:151, success:151, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:25 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/06_insert_part.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:25 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/06_insert_part.sql] has been executed, and cost: 0.031s, total:21, success:21, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:25 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/07_insert_partsupp.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/07_insert_partsupp.sql] has been executed, and cost: 0.114s, total:81, success:81, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/08_insert_region.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/08_insert_region.sql] has been executed, and cost: 0.004s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/09_insert_supplier.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/09_insert_supplier.sql] has been executed, and cost: 0.004s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/02_LOAD/10_select_count.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/02_LOAD/10_select_count.sql] has been executed, and cost: 0.016s, total:8, success:8, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q1.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q1.sql] has been executed, and cost: 0.028s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q10.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q10.sql] has been executed, and cost: 0.007s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q11.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q11.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q12.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q12.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q13.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q13.sql] has been executed, and cost: 0.006s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q14.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q14.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q15.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q15.sql] has been executed, and cost: 0.004s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q16.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q16.sql] has been executed, and cost: 0.008s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q17.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q17.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q18.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q18.sql] has been executed, and cost: 0.006s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q19.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q19.sql] has been executed, and cost: 0.01s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q2.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q2.sql] has been executed, and cost: 0.006s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q20.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q20.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q21.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q21.sql] has been executed, and cost: 0.006s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q22.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q22.sql] has been executed, and cost: 0.007s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q3.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q3.sql] has been executed, and cost: 0.008s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q4.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q4.sql] has been executed, and cost: 0.005s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q5.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q5.sql] has been executed, and cost: 0.007s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q6.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q6.sql] has been executed, and cost: 0.006s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q7.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q7.sql] has been executed, and cost: 0.011s, total:3, success:3, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q8.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q8.sql] has been executed, and cost: 0.008s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/03_QUERIES/q9.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/03_QUERIES/q9.sql] has been executed, and cost: 0.011s, total:2, success:2, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Executor:25 - Start to execute the script file[./cases/benchmark/tpch/04_CLEANUP/01_DROP.sql] now, and it will take a few moment,pleas wait......
    2022-10-01 09:18:26 INFO  Executor:186 - The script file[./cases/benchmark/tpch/04_CLEANUP/01_DROP.sql] has been executed, and cost: 0.015s, total:9, success:9, failed:0, ignored:0, abnoraml:0
    2022-10-01 09:18:26 INFO  Tester:136 - All the scripts in the path[./cases/benchmark/tpch] have been excuted.Now start to create the test report.
    2022-10-01 09:18:26 INFO  TestReport:49 - [SUMMARY] COST : 1s, TOTAL :952, SUCCESS : 952, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/01_DDL/01_create_table.sql] COST : 0.02s, TOTAL :11, SUCCESS :11, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/02_insert_customer.sql] COST : 0.032s, TOTAL :16, SUCCESS :16, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/03_insert_lineitem.sql] COST : 1.584s, TOTAL :602, SUCCESS :602, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/04_insert_nation.sql] COST : 0.008s, TOTAL :4, SUCCESS :4, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/05_insert_orders.sql] COST : 0.288s, TOTAL :151, SUCCESS :151, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/06_insert_part.sql] COST : 0.031s, TOTAL :21, SUCCESS :21, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/07_insert_partsupp.sql] COST : 0.114s, TOTAL :81, SUCCESS :81, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/08_insert_region.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/09_insert_supplier.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/02_LOAD/10_select_count.sql] COST : 0.016s, TOTAL :8, SUCCESS :8, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q1.sql] COST : 0.028s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q10.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q11.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q12.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q13.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q14.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q15.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q16.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q17.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q18.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q19.sql] COST : 0.01s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q2.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q20.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q21.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q22.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q3.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q4.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q5.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q6.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q7.sql] COST : 0.011s, TOTAL :3, SUCCESS :3, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q8.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/03_QUERIES/q9.sql] COST : 0.011s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  TestReport:54 - [./cases/benchmark/tpch/04_CLEANUP/01_DROP.sql] COST : 0.015s, TOTAL :9, SUCCESS :9, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    2022-10-01 09:18:26 INFO  Tester:138 - The test report has been generated in files[report.txt,report.xml].
    2022-10-01 09:18:26 INFO  Tester:144 - The execution success rate is 100%, and not less than config value 100%,this test succeed.

    咱们能够看一下 report.txt 察看测试用例后果

    cd ./report/ 
    [root@motest report]# cat report.txt 
    [SUMMARY] COST : 1s, TOTAL :952, SUCCESS : 952, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/01_DDL/01_create_table.sql] COST : 0.02s, TOTAL :11, SUCCESS :11, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/02_insert_customer.sql] COST : 0.032s, TOTAL :16, SUCCESS :16, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/03_insert_lineitem.sql] COST : 1.584s, TOTAL :602, SUCCESS :602, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/04_insert_nation.sql] COST : 0.008s, TOTAL :4, SUCCESS :4, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/05_insert_orders.sql] COST : 0.288s, TOTAL :151, SUCCESS :151, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/06_insert_part.sql] COST : 0.031s, TOTAL :21, SUCCESS :21, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/07_insert_partsupp.sql] COST : 0.114s, TOTAL :81, SUCCESS :81, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/08_insert_region.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/09_insert_supplier.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/02_LOAD/10_select_count.sql] COST : 0.016s, TOTAL :8, SUCCESS :8, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q1.sql] COST : 0.028s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q10.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q11.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q12.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q13.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q14.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q15.sql] COST : 0.004s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q16.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q17.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q18.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q19.sql] COST : 0.01s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q2.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q20.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q21.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q22.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q3.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q4.sql] COST : 0.005s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q5.sql] COST : 0.007s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q6.sql] COST : 0.006s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q7.sql] COST : 0.011s, TOTAL :3, SUCCESS :3, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q8.sql] COST : 0.008s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/03_QUERIES/q9.sql] COST : 0.011s, TOTAL :2, SUCCESS :2, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%
    [./cases/benchmark/tpch/04_CLEANUP/01_DROP.sql] COST : 0.015s, TOTAL :9, SUCCESS :9, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%

    同理,咱们如果须要执行其余的测试用例,只须要将对应的 cases 复制过去,运行时指定对应的门路即可

退出移动版