简体   繁体   English

travis-ci 工作服

[英]Coveralls in travis-ci

I have a repository in github using travis-ci我在 github 中有一个使用 travis-ci 的存储库

  https://github.com/alu0100786330/prct09

And I want to integrate coverall with travis, I'm using cloud9 and this is the URL我想将工作服与 travis 集成,我使用的是 cloud9,这是 URL

 https://ide.c9.io/alu0100786330/prt9

I add to the Gemspec this lines我添加到 Gemspec 这条线

  gem 'coveralls', require: false

*To the .coveralls.yml *到 .coveralls.yml

 service_name: travis-ci
 repo_token: kzOty157GlK2mMpKsSAjoeDGJ6bfnfarQ

And to the spec_helper in the top以及顶部的 spec_helper

 require 'coveralls'
 Coveralls.wear!

I execute the bundle install and push the changes to the repository and these are the error that appear in my travis我执行bundle install并将更改推送到存储库,这些是出现在我的 travis 中的错误

    https://travis-ci.org/alu0100786330/prct09

Coverall errors整体错误

How can I fix the mistakes?我该如何修正错误?

First of all, you must not write your token on a public repository, as someone comentted on your question.首先,你不能像有人评论你的问题那样将你的令牌写在公共存储库上。 Starting by testing it locally.从本地测试开始。

export COVERALLS_REPO_TOKEN=my-token

Then execute your build commamds on ruby to create the report.然后在 ruby​​ 上执行您的构建命令以创建报告。 If you already added your github repo at https://coveralls.io/ it should create a report for you.如果您已经在https://coveralls.io/添加了您的 github 存储库,它应该为您创建一个报告。 Now you can configure https://travis-ci.com/github/your-repo by going in more options -> settings -> Environment Variables and add COVERALLS_REPO_TOKEN and your token.现在您可以通过进入more options -> settings -> Environment Variables并添加COVERALLS_REPO_TOKEN和您的令牌来配置https://travis-ci.com/github/your-repo

Now on the .travis-ci.yml file you add the same lines that you used to create the coverall report.现在,在.travis-ci.yml文件中添加用于创建整体报告的相同行。

script:
  - your command to generate the report
after_success:
  - your command to upload the report

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM