Skip to main content

Sharpshot will help you tests more easily! Created: Lijiawei. Version 1.0.2

Project description

精准测试

SharpShot

SharpShot

一个专注于精准测试的工具,旨在提供一套强大而灵活的工具集,帮助开发人员和测试人员进行精细化、全面化的测试。该工具集结合了高效的测试技术和先进的分析功能,使用户能够快速、准确地识别和解决软件系统中的问题。

介绍

分析 java 项目的两次 git 提交差异对项目的影响,精准定位受影响的接口 并生成调用链数据。

实现效果

效果图

原理

  1. 通过代码改动定位代码影响,并不断遍历受影响的类和方法直至找到最上层的controller层
  2. 通过javalang语法解析获取每个Java文件的import class extends implements declarators methods 等信息
  3. 通过unidiff 解析git diff信息(diff file, added_line_num, removed_lin_num)
  4. 然后根据文件增删的代码行去判断影响了哪些类和方法,不断遍历受影响的类和方法直至找到最上层的controller层
  5. 分析出两次commit id之间代码改动所带来的影响,输出受影响的接口 并生成调用链路图。

环境部署

要求python >= 3.9

pip install sharpshot

使用说明

  1. 首先获取 gitlab 的 access_token

https://git.openutx.com/-/profile/personal_access_tokens

  1. 运行
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharpshot-1.0.2.tar.gz (62.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sharpshot-1.0.2-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

Details for the file sharpshot-1.0.2.tar.gz.

File metadata

  • Download URL: sharpshot-1.0.2.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for sharpshot-1.0.2.tar.gz
Algorithm Hash digest
SHA256 af8d60dcb6c26d4d9c4af609dc28c3c0bdd93a82b570c808a86313cba9f1f12b
MD5 62fdfe592c26bbc6b7840223724b0594
BLAKE2b-256 9f78bf90809134d05011199fc855f29b3939f908d4bab85572b81655d455c017

See more details on using hashes here.

File details

Details for the file sharpshot-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: sharpshot-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for sharpshot-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a377cc49495c65146f9747d522b50e8a5da73ec5ec91d646144108a4a35f5369
MD5 3208623cfbe1cba351b5bc3292f88f2e
BLAKE2b-256 04be368df7d1bfac8036ed3ba88f69a68d5f8f914dd7cdbada147bc309fbd893

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page