1 Star 0 Fork 4

xubangduo/BinaryBugSearcher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
example.py 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
tanghuikang 提交于 2022-02-14 17:27 . README and example.py
import os
from bbs import BugSearcher, CaseRunner, util, cmd
class CaseRunnerImpl(CaseRunner):
"""
Extends CaseRunner, run and check should be implemented
"""
def __init__(self):
super(CaseRunnerImpl, self).__init__()
self.log_file = 'log.log'
def run(self, commit_id=""):
"""
Prepare work and running case,including setting environment parameter and everything needed
Args:
commit_id (string): The commit id string.
"""
os.environ['XXX'] = 'XXX'
self.log_file = 'log_{}.log'.format(commit_id)
cmd.execute_cmd_quiet('python -m pytest -s xxx > {} 2>&1'.format(self.log_file))
def check(self):
"""
Check whether the case pass
returns:
bool, whether the case passed.
"""
return cmd.execute_cmd_quiet('grep "1 passed" {}'.format(self.log_file))
pass
def search():
case_runner = CaseRunnerImpl()
project_path = "/XXX/mindspore/"
hardware_info = [util.kAscendPlatformName, util.kArmArchName, util.kLinuxOsName]
latest_pass_commit = "XXX"
earliest_fail_commit = "XXX"
bug_searcher = BugSearcher(case_runner, project_path, hardware_info, latest_pass_commit,
earliest_fail_commit=earliest_fail_commit)
bug_searcher.search_bug()
if __name__ == '__main__':
search()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xubangduo/binary-bug-searcher.git
git@gitee.com:xubangduo/binary-bug-searcher.git
xubangduo
binary-bug-searcher
BinaryBugSearcher
master

搜索帮助