如何在 dev_appserver 自动编译后运行 Golang 测试?

huangapple go评论72阅读模式
英文:

How to run golang tests after automatic compile from dev_appserver

问题

我正在运行dev_appserver.py,所以它会在我保存go文件时自动构建(由于我需要的log_level,我需要运行这个而不是goapp)。

当构建成功时,我希望项目的测试(goapp test)能够自动运行。我该如何做到这一点?

英文:

I am running dev_appserver.py and so it auto builds as I save go files (I need to run this and not goapp because of log_level I need).

When there is a successful build I would like the tests for the project (goapp test) to run automatically. How can I do this?

答案1

得分: 2

你可以在一个单独的终端窗口中使用类似<https://github.com/nf/watch>的工具。它将与dev_appserver.py并行重新运行测试。

安装:go get github.com/nf/watch

从你的应用目录中运行:watch goapp test

英文:

You could use something like <https://github.com/nf/watch> in a separate terminal window. It'll re-run tests in parallel to dev_appserver.py.

Install: go get github.com/nf/watch

Run from your app's directory: watch goapp test

答案2

得分: 0

使用AppEngine时,我像这样使用entr应用程序:

$ find ./*.go | entr goapp test
英文:

With AppEngine, I use the entr app like so:

$ find ./*.go | entr goapp test

huangapple
  • 本文由 发表于 2013年12月14日 23:40:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/20585122.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定