bitpay / ruby-client

Powerful, flexible, lightweight SDK for the BitPay Bitcoin Payment Gateway API.
MIT License
79 stars 64 forks source link

Fix Travis failure on nil ENV['BITPAYPEM'] #52

Closed javierjulio closed 8 years ago

javierjulio commented 8 years ago

The commit 671fe5657b3558c242fa2367e979c3d9ca571b2b introduced (a new ENV['BITPAYPEM'])[https://github.com/bitpay/ruby-client/commit/671fe5657b3558c242fa2367e979c3d9ca571b2b#diff-2fbdf6e6f53a9bb9a2c06059507373a8R18] but it wasn't defined anywhere. There is already (a constant called PEM in the spec_helper.rb file)[https://github.com/bitpay/ruby-client/blob/master/spec/spec_helper.rb#L12] so figured it should just use that. This could be moved to the constants config file instead if preferred and use the ENV variable and default to a value if ENV variable is nil.

javierjulio commented 8 years ago

For the record I verified that an earlier commit was receiving the same Travis errors I was on my PR #51. The Travis failures from both https://travis-ci.org/bitpay/ruby-client/builds/80143710 and from my new PR https://travis-ci.org/bitpay/ruby-client/builds/148928762

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 91.096% when pulling 9e0466cb833152407bb712b739aa9ef531b9a0e5 on javierjulio:patch-2 into 0ec4bb11056df5fd581834a25aa56c9df1166e25 on bitpay:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.06%) to 91.156% when pulling 95d859b7efd51a9c1309f223e7ea65bcbca2e39a on javierjulio:patch-2 into 0ec4bb11056df5fd581834a25aa56c9df1166e25 on bitpay:master.

javierjulio commented 8 years ago

Now getting 500: Unauthorized sin (BitPay::BitPayError) after implementing this update. Getting in a little over my head here but was trying to help out resolve these failures to get my PR #51 accepted. Happy to help further if I can get a little more advice/direction on this since it seems its been occurring for a year now (last Sept).

philosodad commented 8 years ago

Pull requests will always fail, because they cannot use the encrypted environment variables (such as BITPAYPEM). However, these variables are defined in Travis.

javierjulio commented 8 years ago

But they are failing in Travis because the ENV variable is nil. Unless I misread/misunderstood.

philosodad commented 8 years ago

Because the pull request can't read encrypted environment variables. Hence nil.

javierjulio commented 8 years ago

Ok thanks. Sorry, I thought I could help address this to get tests passing. If there is something I can do please let me know. I started on this as I was to fix so PR #51 could be accepted. Figured that would prevent it.

kleetus commented 8 years ago

Private keys/account information does not belong in the code base though I understand the problem that you are attempting to solve. Encrypted environment variables in BitPay's Travis config for this repo is the place to store this information, yet those values aren't available to forks, unfortunately. For each merge request, I will pull the changes and run locally.

javierjulio commented 8 years ago

Yes this was more involved and I didn't really understand what was going on. Thanks @kleetus.