Skip to content
This repository was archived by the owner on Nov 18, 2026. It is now read-only.

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

Closed
javierjulio wants to merge 2 commits into
bitpay:masterfrom
javierjulio:patch-2
Closed

javierjulio wants to merge 2 commits into
bitpay:masterfrom
javierjulio:patch-2

Conversation

@javierjulio

Copy link
Copy Markdown
Contributor

The commit 671fe56 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.

The commit 671fe56 introduced (a new ENV['BITPAYPEM'])[bitpay@671fe56#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

Copy link
Copy Markdown
Contributor Author

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

coveralls commented Aug 1, 2016 •

Copy link
Copy Markdown

Coverage Status

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

The tests failing are for cucumber so using the constant in step_helpers.rb didn't fix anything since we need it defined here. I saw it defined in spec_helper.rb but that's only for rspec tests.
@coveralls

coveralls commented Aug 1, 2016 •

Copy link
Copy Markdown

Coverage Status

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

@javierjulio

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

@javierjulio

Copy link
Copy Markdown
Contributor Author

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

@philosodad

Copy link
Copy Markdown
Contributor

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

@javierjulio

Copy link
Copy Markdown
Contributor Author

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

kleetus commented Aug 22, 2016

Copy link
Copy Markdown
Contributor

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.

@kleetus kleetus closed this Aug 22, 2016
@javierjulio

Copy link
Copy Markdown
Contributor Author

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

@javierjulio
javierjulio deleted the patch-2 branch August 22, 2016 17:34
@sanemat sanemat mentioned this pull request Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants