- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我认为我的问题与这些问题有关,但解决方案在我的案例中不起作用:How to run Node.js and Ruby tests within one project on Travis CI 和 Is it possible to set up travis to run tests for several languages?
我有一个 github 存储库,其中包含一个带有微型 Angularjs 前端的小型 Golang 应用程序。我想同时运行 go-tests 和 Karma-tests。我看到两个选项:
为一个 repo 运行两个 travis-ci 构建(我不知道如何这样做)
在一个构建中运行两个测试(因为 travis-ci 中的 Node 版本太旧 (0.10),所以没有成功)。
构建运行了 60 多分钟,然后停止并显示“ fatal error :CALL_AND_RETRY_2 分配失败 - 进程内存不足”。构建显示了大量这样的警告:npm WARN engine escodegen@1.8.0: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.36","npm ":"1.4.28"})
我尝试将构建作为 node_js 运行,但随后“go get xyz”不起作用。
我的 .travis.yml 文件:
language: go
go:
- 1.5
env:
- TRAVIS_NODE_VERSION="0.12"
install:
- export PATH=$HOME/gopath/bin:$PATH
- go get golang.org/x/tools/cmd/cover
- go get -v github.com/axw/gocov
- go install github.com/axw/gocov/gocov
- go get github.com/GeertJohan/go.rice
# we do not need the rice tool!
- go get github.com/xeipuuv/gojsonschema
- go get github.com/finklabs/ttime
- go get github.com/finklabs/graceful
- go get github.com/gorilla/mux
before_script:
- npm install bower
- npm install --dev
- bower install
script:
- gocov test | gocov report
- npm test
最佳答案
有时问题出在机器前面...我找到了一个很好的解决方法,我想与您分享。
我在 https://drone.io/ 上创建了一个帐户在设置选项卡中,我为“Go1”选择了一个构建并添加了以下命令:
# install gogrinder dependencies
go get ./...
# install test dependencies
go get golang.org/x/tools/cmd/cover
go get -v github.com/axw/gocov
go install github.com/axw/gocov/gocov
# install nodejs requirements
npm -d install
./node_modules/bower/bin/bower install
# run the tests on the go code
gocov test | gocov report
# run the tests on the Angularjs frontend
npm test
现在我又回到了运行 Golang 和 Karma 测试的 CI 服务器的轨道上。
关于node.js - 如何在 Travis CI 上的一个项目中运行 Golang 和 Karma 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34767628/
我是一名优秀的程序员,十分优秀!