Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_67397764
soar
提交
f9d7a849
S
soar
项目概览
m0_67397764
/
soar
与 Fork 源项目一致
Fork自
Xiaomi / soar
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
soar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f9d7a849
编写于
1月 16, 2019
作者:
martianzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bats test case
上级
a0b5adc7
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
130 addition
and
2519 deletion
+130
-2519
test/fixture/test_Check_soar_query_for_input_string.golden
test/fixture/test_Check_soar_query_for_input_string.golden
+0
-2505
test/fixture/test_Check_the_default_config_of_the_changes.yaml
...fixture/test_Check_the_default_config_of_the_changes.yaml
+126
-0
test/main.bats
test/main.bats
+4
-14
未找到文件。
test/fixture/test_Check_soar_query_for_input_string.golden
已删除
100644 → 0
浏览文件 @
a0b5adc7
此差异已折叠。
点击以展开。
test/fixture/test_Check_the_default_config_of_the_changes.yaml
0 → 100644
浏览文件 @
f9d7a849
online-dsn
:
user
:
online-test
password
:
'
********'
net
:
tcp
addr
:
192.168.12.200:3307
schema
:
information_schema
charset
:
utf8mb4
collation
:
utf8mb4_general_ci
loc
:
GMT
tls
:
dsfsfdsf
server-public-key
:
AAAAB3NzaC1yc2EAAAADAQABAAABAQC0JFhoEgrl5/51UHlIIlfWwhiJLR/EEeF8enGnY0PnAldLQ8STdWD8Um2BUtVjgE9COl1X3mN4vMvnSm8A6aPn66enHn0hKzwh1GvcuZNTPgeaZyGKWG0kcvbziUjAPsxxvRvvoaUspSkRYAP/9vpq3SImJKuIHCPfjnGMurKV1n7W/QfpmNjUEwYOswDjL1Ik6Jy6Lrzf8T0hQEy+dYoV4zNM0HcROCXFuu1LyG+WTch3FW660BecNT8+c4sVTHuUMXgGot8OUtwgfXrt5ZL5as7cuyKiWsLVrtrtvL3T0ZHlV8qxQ3DT1gqjSw6jBOzyDOx3jwthAbdsWjyK4Oqp
maxallowedpacket
:
419437
params
:
charset
:
utf8mb4
timeout
:
60
read-timeout
:
70
write-timeout
:
80
allow-native-passwords
:
false
allow-old-passwords
:
true
disable
:
false
test-dsn
:
user
:
test-user
password
:
'
********'
net
:
tcp
addr
:
192.168.12.34:3309
schema
:
information_schema
charset
:
utf8mb4
collation
:
utf8mb4_general_ci
loc
:
GMT
tls
:
aabbbaa
server-public-key
:
this is a tset serverpublic
maxallowedpacket
:
4194309
params
:
charset
:
utf8mb4
timeout
:
50
read-timeout
:
40
write-timeout
:
30
allow-native-passwords
:
false
allow-old-passwords
:
true
disable
:
false
allow-online-as-test
:
true
drop-test-temporary
:
false
cleanup-test-database
:
true
only-syntax-check
:
true
sampling-statistic-target
:
110
sampling
:
true
sampling-condition
:
aaa
profiling
:
true
trace
:
true
explain
:
false
delimiter
:
;
log-level
:
5
log-output
:
/dev/null
report-type
:
html
report-css
:
sdfs
report-javascript
:
sdfsd
report-title
:
SQL优化分析报告-test
markdown-extensions
:
92
markdown-html-flags
:
10
ignore-rules
:
-
COL.012
rewrite-rules
:
-
delimiter
-
orderbynull
-
groupbyconst
-
dmlorderby
-
having
-
star2columns
-
insertcolumns
-
distinctstar
blacklist
:
/tmp/blacklist
max-join-table-count
:
12
max-group-by-cols-count
:
15
max-distinct-count
:
7
max-index-cols-count
:
2
max-text-cols-count
:
3
max-total-rows
:
9999991
max-query-cost
:
9992
spaghetti-query-length
:
2041
allow-drop-index
:
true
max-in-count
:
101
max-index-bytes-percolumn
:
762
max-index-bytes
:
3073
allow-charsets
:
-
utf8
-
utf8mb4
allow-collates
:
[]
allow-engines
:
-
innodb
-
tokudb
max-index-count
:
12
max-column-count
:
41
max-value-count
:
102
index-prefix
:
idx_
unique-key-prefix
:
uk_
max-subquery-depth
:
6
max-varchar-length
:
1022
column-not-allow-type
:
-
boolean
min-cardinality
:
2
explain-sql-report-type
:
pretty
explain-type
:
extended
explain-format
:
traditional
explain-warn-select-type
:
-
"
"
explain-warn-access-type
:
-
ALL
explain-max-keys
:
31
explain-min-keys
:
10
explain-max-rows
:
10002
explain-warn-extra
:
-
Using temporary
-
Using filesort
explain-max-filtered
:
120
explain-warn-scalability
:
-
O(log(n))
show-warnings
:
true
show-last-query-cost
:
true
query
:
"
"
list-heuristic-rules
:
true
list-rewrite-rules
:
true
list-test-sqls
:
true
list-report-types
:
true
verbose
:
true
dry-run
:
false
max-pretty-sql-length
:
1022
test/main.bats
浏览文件 @
f9d7a849
...
@@ -35,31 +35,21 @@ load test_helper
...
@@ -35,31 +35,21 @@ load test_helper
}
}
# 6. soar 使用配置文件修改默认参数是否正确
# 6. soar 使用配置文件修改默认参数是否正确
# 注意
不启用的配置为默认配置项目
# 注意
:
不启用的配置为默认配置项目
@test "Check the default config of the changes" {
@test "Check the default config of the changes" {
${SOAR_BIN} -config ${BATS_FIXTURE_DIRNAME}/${BATS_TEST_NAME}.golden -print-config -log-output=/dev/null > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
${SOAR_BIN} -config ${BATS_FIXTURE_DIRNAME}/${BATS_TEST_NAME}.yaml -print-config -log-output=/dev/null > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
# 去掉 2019/01/12 05:45:14.922 [D] [config.go:429] go-sql-driver/mysql.ParseDSN Error: invalid value / unknown server pub
sed -n '3,$p' ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden1
mv ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden1 ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
run golden_diff
run golden_diff
[ $status -eq 0 ]
[ $status -eq 0 ]
}
}
# 8. 执行 soar -query 为string时是否正常
# 8. 执行 soar -query 为文件时是否正常
@test "Check soar query for input string" {
${SOAR_BIN} -query "`${SOAR_BIN} -list-test-sqls`" > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
run golden_diff
[ $status -eq 0 ]
}
# 8. 执行 soar -query 为文件时是否正常
@test "Check soar query for input file" {
@test "Check soar query for input file" {
${SOAR_BIN} -query <(${SOAR_BIN} -list-test-sqls) > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
${SOAR_BIN} -query <(${SOAR_BIN} -list-test-sqls) > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
run golden_diff
run golden_diff
[ $status -eq 0 ]
[ $status -eq 0 ]
}
}
# 9.
管道输入 sql
是否正常
# 9.
管道输入 SQL
是否正常
@test "Check soar for pipe input" {
@test "Check soar for pipe input" {
${SOAR_BIN} -list-test-sqls |${SOAR_BIN} > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
${SOAR_BIN} -list-test-sqls |${SOAR_BIN} > ${BATS_TMP_DIRNAME}/${BATS_TEST_NAME}.golden
run golden_diff
run golden_diff
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录