goc/doc/things_about_e2e_test.md
2021-07-22 23:02:27 +08:00

19 lines
897 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# v2 版本的集成测试设计
## 回顾 v1
在 v1 版本中,我们选用了 [bats](https://github.com/sstephenson/bats) 这个框架来做集成测试。当时这么做有如下原因:
1. bats 框架是基于 bash 的,在 case 里面调用命令贴合 goc 实际的使用方法,非常直观。
但是实际编写有如下难度:
1. bats 中运行并行的任务时非常难受,同时运行的两个进程属于前后台关系,实测对 bats 的 case 有破坏性。
2. 由于有双进程,又受限于 bash 的表达能力,实际 case 编写并不容易,其它维护者难以上手。
3. 无法跨平台,或者跨平台叫麻烦。
## 思考 v2
v2 版本中要支持多平台,包括 Windows基于这一点就可以否定继续使用 bats 了。
剩下就是 Python 或者 Go 的测试框架了。考虑到内部团队的技术栈,这里就选用了 ginkgo。