【问题标题】:Github: What does it mean when the Travis build has failed for a pull request?Github:当 Travis 构建因拉取请求而失败时,这意味着什么?
【发布时间】:2013-04-13 11:55:16
【问题描述】:

我分叉了一个现有的存储库,然后克隆了它。然后我对代码进行了更改,然后将更改推送到我的分叉存储库。然后我创建了一个对基础仓库的拉取请求。

Travis 构建完成后,我发现它失败了。它的本质是什么?

【问题讨论】:

标签: python git github


【解决方案1】:

看起来有些测试失败了,例如:

1) MtGox::Client#buy! should place a bid
     Failure/Error: buy = @client.buy!(0.88, 0.89)
     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: POST https://data.mtgox.com/api/0/buyBTC.php with body 'amount=0.88&price=0.89&nonce=1321745961249676' with headers {'Accept'=>'*/*', 'Content-Type'=>'application/x-www-form-urlencoded', 'Rest-Key'=>'key', 'Rest-Sign'=>'ixxn/IrNcHJVB6ztBisOVfUSfm3PUVK3n/YAb2lACdFRrQWFFFMDBTbwIBu8aELgBmgL8j3qqIpY99ozh9FjcA==', 'User-Agent'=>'Ruby'}

       You can stub this request with the following snippet:

       stub_request(:post, "https://data.mtgox.com/api/0/buyBTC.php").
         with(:body => {"amount"=>"0.88", "nonce"=>"1321745961249676", "price"=>"0.89"},
              :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/x-www-form-urlencoded', 'Rest-Key'=>'key', 'Rest-Sign'=>'ixxn/IrNcHJVB6ztBisOVfUSfm3PUVK3n/YAb2lACdFRrQWFFFMDBTbwIBu8aELgBmgL8j3qqIpY99ozh9FjcA==', 'User-Agent'=>'Ruby'}).
         to_return(:status => 200, :body => "", :headers => {})

       registered request stubs:

       stub_request(:post, "https://mtgox.com/api/0/buyBTC.php").
         with(:body => "amount=0.88&price=0.89&nonce=1321745961249676",
              :headers => {'Rest-Key'=>'key', 'Rest-Sign'=>'ixxn/IrNcHJVB6ztBisOVfUSfm3PUVK3n/YAb2lACdFRrQWFFFMDBTbwIBu8aELgBmgL8j3qqIpY99ozh9FjcA=='})

       ============================================================
     # ./lib/mtgox/request.rb:16:in `request'
     # ./lib/mtgox/request.rb:10:in `post'
     # ./lib/mtgox/client.rb:178:in `buy!'
     # ./spec/mtgox/client_spec.rb:211:in `block (3 levels) in <top (required)>'

当您在 github 上提交拉取请求时,如果您配置了 travis,则 travis 将为该特定版本的工作树开始构建。如果 travis 被配置为运行一些测试并指示失败(恰好在您的情况下),它将指示 Travis 构建失败。

理想情况下,您需要在提交拉取请求的分支中修复这些错误,并让 travis 构建成功,然后上游作者才会批准您的拉取请求。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-10
    • 1970-01-01
    • 1970-01-01
    • 2021-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    相关资源
    最近更新 更多