GPT - Unit Test这是一个基于 OpenAI Chatgpt(GPT - 3.5) 模型开发的单元测试自动生成插件 demo 体验版。 使用这个插件前,你需要配置你的 openAI key, 并保证其中有足够的额度可以完成单元测试的自动生成(一个生成有效单元测试的文件将等同于消耗一次 chatGpt 额度)。 请关注 openAI 的隐私性问题,所有被自动生成用例的文件都会将代码文件上传到训练集,请避免使用非个人代码或非公开代码测试! 安装在安装使用插件前,请保证 vscode 的 engines 版本大于等于 1.77.0, 并配置好代理和虚拟 ip 等访问 openAi 的前置操作,避免 openAi 的请求超时或中断 除此之外,你只需要在 vscode extensions 中搜索 ChatGPT - UI Unit Test 即可完成插件的安装,在使用 & 配置项的模块会分别说明
使用GPT - Unit Test 的使用很简单,在从 vscode extensions 中完成安装后,所有文件夹和文件都有提供生成单元测试的入口,你只需要右键选择 generate unit test 即可使用插件 如果你没有配置你的 openApi key,那么会自动弹窗要求你填入,并在每次生成单元测试前,将自动完成 key 的合法性和额度有效验证,不需要你额外进行任何操作,你只需要:
当然,可能你还需要针对你的项目配置一些自定义的内容,比如单测的文件格式,需要忽略的内容,使用的测试技术栈等,这些我们将在配置项进行详细说明 配置项下面是 GPT - Unit Test 目前提供的所有配置项
贡献 & issue目前还没有提供插件的贡献方式,短期和未来也许也不会有,插件并没有太多复杂的逻辑,除 openAI 流式接入外,剩下的主要是一些内容的字符提取和文件 I/O 逻辑 目前 GPT - Unit Test 还是一个 MVP 版本,没有经历过太多项目的验证与测试,如果你在使用阶段遇到了预期之外的问题或者体验上的优化调整,可以通过邮件(12904333700@qq.com)的方式或者 通过掘金私信我(https://juejin.cn/user/2714061017452557) 我改正, 为了提高解决问题的效率,希望可以提供以下信息帮助排查:
收到问题后,我会在三个工作日内处理,并且给你答复,感谢对 GPT - Unit Test 的试用与支持! GPT - Unit TestThis is a demo version of the unit test automatic generation plugin developed based on the OpenAI Chatgpt (GPT -3.5) model. Before using this plugin, you need to configure your openAI key and ensure that there is enough quota to complete the automatic generation of unit tests (a file that generates valid unit tests will be equivalent to consuming one chatGpt quota). Please pay attention to the privacy issues of openAI. All files that are automatically generated into use cases will upload the code files to the training set. Please avoid using non personal or non-public code for testing! InstallationBefore installing and using the plugin, please ensure that the engines version of vscode is greater than or equal to 1.77.0,and configure the proxy and virtual IP to access the pre operation of openAi, to avoid timeout or interruption of openAi requests In addition, you only need to search for ChatGPT - UI Unit Test in vscode extensions to complete the installation of the plugin. The modules using the&configuration items will be explained separately
UsingThe use of GPT - Unit Test is very simple. After installation from vscode extensions, all folders and files have an entry point for generating unit tests. You only need to right-click and select Generate Unit Test to use the plugin If you have not configured your openApi key, it will automatically pop up and require you to fill it in. Before each unit test is generated, the legality and validity of the key will be automatically verified. No additional actions are required, you only need to:
Of course, you may also need to configure some custom content for your project, such as the file format for single testing, the content to be ignored, the testing technology stack used, etc. We will provide detailed explanations in the * _ Configuration Item _ * Configuration ItemThe following are all the configuration items currently provided by GPT - Unit Test
Contribution&IssueAt present, there is no way to provide a contribution method for plugins, and there may not be any in the short term or in the future. Plugins do not have much complex logic, except for openAI streaming access, the rest is mainly about character extraction and file I/O logic for some content At present, GPT - Unit Test is still an MVP version and has not undergone much project validation and testing. If you encounter unexpected problems or experience optimization adjustments during the use phase, you can send them via email( 12904333700@qq.com )Either by digging gold or sending me private messages( https://juejin.cn/user/2714061017452557 )I have corrected and in order to improve the efficiency of problem-solving, I hope to provide the following information to assist in troubleshooting:
After receiving the question, I will handle it within three working days and give you a response. Thank you for your trial and support of GPT - Unit Test! |