精准测试
SharpShot
一个专注于精准测试的工具,旨在提供一套强大而灵活的工具集,帮助开发人员和测试人员进行精细化、全面化的测试。该工具集结合了高效的测试技术和先进的分析功能,使用户能够快速、准确地识别和解决软件系统中的问题。
介绍
分析 java 项目的两次 git 提交差异对项目的影响,精准定位受影响的接口 并生成调用链数据。
实现效果
原理
- 通过代码改动定位代码影响,并不断遍历受影响的类和方法直至找到最上层的controller层
- 通过javalang语法解析获取每个Java文件的import class extends implements declarators methods 等信息
- 通过unidiff 解析git diff信息(diff file, added_line_num, removed_lin_num)
- 然后根据文件增删的代码行去判断影响了哪些类和方法,不断遍历受影响的类和方法直至找到最上层的controller层
- 分析出两次commit id之间代码改动所带来的影响,输出受影响的接口 并生成调用链路图。
环境部署
要求python >= 3.9
pip install sharpshot
使用说明
- 首先获取 gitlab 的 access_token
- 运行
sharpshot pr=https://git.openutx.com/utx/utx-im/-/merge_requests/370 username=utxuser access_token=xxxx
pr 为 merge request 的地址,username 为 gitlab 用户名,access_token 为 gitlab 的 access_token
Metadata
Release files for sharpshot 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sharpshot-1.0.2.tar.gz | 62.6 kB | Without provenance | Details for sharpshot-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sharpshot-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for sharpshot-1.0.2-py3-none-any.whl |
Total release size: 126.7 kB
Security for sharpshot 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.