On Tue, Feb 23, 2021 at 02:35:46PM +0800, Wang Chenglong wrote:
[Why] The rules to follow when writing the stats script.
Signed-off-by: Wang Chenglong 18509160991@163.com
doc/stats-rule.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 doc/stats-rule.md
diff --git a/doc/stats-rule.md b/doc/stats-rule.md new file mode 100644 index 0000000..94affa7 --- /dev/null +++ b/doc/stats-rule.md @@ -0,0 +1,37 @@ +${LKP_SERVER}/stats/${script} stat脚本规则 +==========================================
+## 对测试用例执行后的结果进行进行统计汇总并存入es数据库。
+1.输出error_id需遵循最原始的报错信息。
- original: {"changed": false, "failures": ["No package yum-plugin-priorities available."], "msg": "Failed to
- install some of the specified packages", "rc": 1, "results": []}
- error_id: error.No-package-yum-plugin-priorities-available: 1
+2.需要抓住所有有价值的错误信息,不能有漏网之鱼。
- catch all kind errors
The English md need show this.
- 抓取所有有价值的报错信息,保存为error_id。
- 全量执行jobs,如果测试用例的退出码为'非零'值,但es中没有error_id.需要添加到stats/${script}中。
You should tell us how to catch all kind errors. - execute all jobs - by es-jobs parse - ...
Thanks, Xueliang
+3.在注释中展示出不易理解的原始error message。
- # original error message
- # {"changed": false, "msg": "Failed to download packages: Cannot download 7.10.2/filebeat-7.10.2-aarch64.rpm:
- # All mirrors were tried", "results": []}
- when /(Failed to download packages: Cannot download .+):/
- output_error $1
- end
+4.需要对输出的error_id中含有的特殊字符进行处理。
- 单引号,空格,冒号等
- def common_error_id(line)
- line = line.chomp
- line.gsub!(/ /, '-')
- line.gsub!(/:/, '') # error.:-'__mysql_packages'-is-undefined: 1
- line.gsub!(/,/, '')
- line.gsub!(/'/, '') # Failed-to-download-metadata-for-repo-'dockerrepo: 1
- line.gsub!(/!/, '') # Distribution-openEuler-is-not-supported-by-this-role!: 1
- line.gsub!(/{%/, ' ')
- line.gsub!(/%}/, ' ')
- line
- end
-- 2.23.0