Giter Site home page Giter Site logo

tommylemon / unitauto-go Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 2.0 37.74 MB

☀️ 机器学习单元测试平台,零代码、全方位、自动化 测试 方法/函数 的正确性、可用性和性能。☀️An unit testing platform powered by machine learning. Coding-free, comprehensive and automatic testing for methods/functions.

Home Page: http://apijson.cn/unit?language=Go

License: Apache License 2.0

Go 97.79% HTML 2.21%
automation go golang golang-library mock mocking-library test-automation testing testing-automation unit-test

unitauto-go's Introduction

unitauto-go

UnitAuto Go 库,可通过 GitHub 仓库等远程依赖。
UnitAuto Go Library for remote dependencies with GitHub repo, etc.

image

同步纯函数:
Sync pure function:
https://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L25-L27 image

struct 成员函数:
strcut member function:
https://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L88-L90 image image

协程异步函数:
goroutine function:
https://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L33-L45 image

异步回调函数:
async callback function:
https://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L72-L81 image


代码覆盖率统计:
Code coverage:
qiniu/goc#349 image image


Demo: https://github.com/TommyLemon/unitauto-go-demo


1. 在 go.mod 中添加 GitHub 仓库

1. Add the GitHub repository to go.mod

	require (
		github.com/TommyLemon/unitauto-go v1.0.0
	)

2. 执行 go get 命令

2. Run go get command

	go get github.com/TommyLemon/[email protected]

3. 启动单元测试服务

3. Start unit testing server

https://github.com/TommyLemon/unitauto-go/blob/main/main.go#L7-L12

func main() {
	unitauto.Start(8082)
}

4. 参考主项目文档来测试

4. Test by following the main repo

https://github.com/TommyLemon/UnitAuto

由于 Go 的反射限制,目前做不到像 Java, Kotlin 版几乎绝对零代码,还需要注册 func 和 struct 的实例,
不过注册代码可以通过 UnitAuto-Admin 前端管理网页设置项 [查看、同步方法文档] 来生成,复制粘贴到被测项目中:
Due to the limitation of Go, it's not almost absolutely coding free like Java and Kotlin,
and you need to write few code to register the funcs and structs to be tested.
However, the code can be generated by clicking the setting item [View/Sync doc] of UnitAuto-Admin,
then you can copy and pasted the "ginCode" into the project under test instead of coding:

https://github.com/TommyLemon/unitauto-go/blob/main/main.go image image


5. 关于作者

5. Author

https://github.com/TommyLemon

如果有什么问题或建议可以 去 APIAuto 提 issue,交流技术,分享经验。
如果你解决了某些 bug,或者新增了一些功能,欢迎 提 PR 贡献代码,感激不尽。
If you have any questions or suggestions, you can create an issue.
If you can added a feature or fixed a bug, please create a pull request, thank you~

6. 其它项目

6. Link

创作不易、坚持更难,右上角点 ⭐ Star 支持下吧,谢谢 ^_^
Please ⭐ Star the repos that you like ^_^

UnitAuto 机器学习零代码单元测试平台,零代码、全方位、自动化 测试 方法/函数 的正确性、可用性和性能

unitauto-go-demo UnitAuto Go Demo,提供用来做单元测试的业务函数

unitauto-py UnitAuto Python 库,可通过 pip 仓库等远程依赖

APIJSON 🚀 腾讯零代码、全功能、强安全 ORM 库 🏆 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构

apijson-go Go 版 APIJSON, 基于Go(>=1.18) + GoFrame2, 支持查询、单表增删改、权限管理等

APIAuto 敏捷开发最强大易用的 HTTP 接口工具,机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释,集 文档、测试、Mock、调试、管理 于一体的一站式体验

SQLAuto 智能零代码自动化测试 SQL 语句执行结果的数据库工具,任意增删改查、任意 SQL 模板变量、一键批量生成参数组合、快速构造大量测试数据

UIGO 📱 零代码快准稳 UI 智能录制回放平台 🚀 自动兼容任意宽高比分辨率屏幕,自动精准等待网络请求,录制回放快、准、稳!

unitauto-go's People

Contributors

tommylemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.