草庐IT

TESTNG_TEST_TIMEOUT

全部标签

Golang 项目 Travis CI Build 失败,错误为 `Makefile:15: recipe for target ' test' failed`

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。这个问题似乎与helpcenter中定义的范围内的编程无关。.关闭3年前。Improvethisquestion我已经为我的Github项目设置了travisbuildCaptain.travis.yml的内容是:language:gogo:-1.12.xscript:makeenv:-GO111MODULE=onGOPROXY=https://proxy.golang.org我的Makefile的内容是:#GoparametersBINARY_FOLDER=./binGOCMD=goGOBUILD=

go test 错过了执行路径上的覆盖

考虑这样的文件结构:api--|_routes.go|_handler.goimpl--|_impl.go|_impl_test.go“impl”文件包含RESTAPI的内部实现,其处理程序和路由分别位于“handler.go”和“route.go”文件中。就打包而言,“api”文件夹下的所有内容都在“api”包中。“impl.go”中的代码在“impl”包中,“impl_test”包中的代码在“impl_test”包中。api-------|_routes|_handlerfunctionsimpl-------|_implfunctionsimpl_test--|_testfunc

go - vendor 问题 : found packages text (doc. 去)和转换(examples_test.go)在我的 vendor

这个问题在这里已经有了答案:Error"can'tloadpackage:packagemy_prog:foundpackagesmy_progandmain"(3个答案)关闭4年前。我遇到了一些问题:enterimagedescriptionhere..\vendor\github.com\spf13\afero\util.go:28:2:在D:\golang\src\services\vendor中找到包文本(doc.go)和转换(examples_test.go)\golang.org\x\text\transform我该如何解决这个问题?谢谢。

GoSonar : how to generate go test -json > report. json

如何生成gotest-json>report.jsonGo语言版本:Go1.10.3SonarQube属性:sonar.go.tests.reportPaths=report.json官方Sonar文档->https://docs.sonarqube.org/display/PLUG/Unit+Tests+Results+Import生成文件.PHONY:testtest:@$(foreachpackage,$(packages),\gotest-coverprofile$(package)/cover.out-covermode=count$(package);).PHONY:cov

gorequest 包 : check specifically for timeout

我正在使用以下包发出出站http请求https://github.com/parnurzeal/gorequest例如,我正在发出如下所示的GET请求res,body,errs=goReq.Get(url).End()我的问题是如何判断请求是否超时。 最佳答案 由于超时方法setsthedealinesfordial,read,andwrite,你可以使用os.IsTimeout(net和net/url包中的所有错误类型都实现了Timeout()bool)。gorequest不支持上下文,所以context.Canceled不必考虑

unit-testing - 安装go lang后无法运行go test程序

尝试运行用Go编写的测试时出现以下错误。我安装了Golang和dep。我是Go的新手,我不确定这里的问题是什么。有人可以帮助我吗?xxxx-dxxxx:testxxxx$gotest#_/Users/xxxx/dev/xxxx/test/xxxx/testapplication_cluster_test.go:10:2:cannotfindpackage"github.com/stretchr/testify/assert"inanyof:/usr/local/Cellar/go/1.10.3/libexec/src/github.com/stretchr/testify/assert

mongodb - 无法解析行 #126 : mongo. 数据库 = mongo_db_test

我正在学习本教程Golang+Revelwebframework+MongodbRESTFulgeneratorfor(revel_mgo)一步一步来,但是当我最终结束它并尝试运行它时,它抛出了这个错误CRIT16:11:18revel_container.go:139:无法加载配置文件error="C:\Users\Userx\go\src\RevelApp\conf\app.conf:无法解析第126行:mongo.database=RevelApp"第126行是这样的:[dev]126-mongo.database=mongo_db_test127-mongo.path=127.

go - [CodeEval][GO] CodeEval 错误 : Process was aborted due to timeout

我正在尝试提交我的https://www.codeeval.com/open_challenges/158/解决方案这是一个冒泡排序。我用GOlang编写代码,在我的PC上它运行良好且快速!我尝试使用go的输入代码示例,我也尝试了自己的一段代码。谁能帮帮我?我尝试以某种方式更改代码,但没有任何效果。提前致谢。 最佳答案 您的代码中可能缺少某些极端情况。参见https://getsatisfaction.com/codeeval/topics/bubble-sort-iterations-are-too-high-causing-so

go - 为特定包运行 go test

我使用以下命令对特定包运行测试去测试fts-runrun_test.gocan'tloadpackage:packagefts:cannotfindpackage"fts"inanyof:/usr/local/Cellar/go/1.11.1/libexec/src/integration(from$GOROOT)/Users/i055555/go/src/fts(from$GOPATH)包裹看起来像gitproj/|----fts|-----command|-----run.go|-----run_test.go|----internal|-----fs.go|-----tb.go|

go - "go test"和 "bazel test"中的不同文件权限错误

如果一个测试想要断言文件权限错误,例如,写入文件系统的根目录,“gotest”返回一个syscall.EACCES错误,而“bazeltest”返回一个系统调用.EPERM。如何让“bazeltest”和“gotest”都通过测试?可以找到一个例子here. 最佳答案 您可以使用bazel--spawn_strategy=standalonetest//...禁用沙箱。我怀疑这会解决这个问题。但是,您可能需要考虑写入/是否是您要测试的行为。如果您需要在不同的操作系统或Docker容器内运行代码,在这种情况下您将获得不同的行为,因此您