-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing endpoints to Reactions #1637
Add missing endpoints to Reactions #1637
Conversation
@nickfloyd Maybe you'd have some insights to help me finish this PR ? 🙏 |
Are you able to run the tests on the main branch following those steps? When I run
On your branch, I see the errors present in CI. There's a code problem to be addressed here before tests are runnable. |
Hey @kfcampbell In the case of my 3 tests though those cassettes don't exist yet so an actual http request need to be made and that's the issue. describe Octokit::Client::Reactions do
before do
Octokit.reset!
@client = oauth_client
end
context 'with repository', :vcr do
before(:each) do
@repo = @client.create_repository('an-repo', auto_init: true)
end
after(:each) do
@client.delete_repository(@repo.full_name)
rescue Octokit::NotFound
end
context 'with release' do
before do
@release = @client.create_release(@repo.full_name, 'v1.0.0')
@reaction = @client.create_release_reaction(@repo.full_name, @release.id, '+1')
end
describe '.release_reactions' do
it 'returns an Array of reactions' do
reactions = @client.release_reactions(@repo.full_name, @release.id)
expect(reactions).to be_kind_of Array
assert_requested :get, github_url("/repos/#{@repo.full_name}/releases/#{@release.id}/reactions")
end
end # .release_reactions
end
end
end I get this error 1) Octokit::Client::Reactions with repository with release .delete_release_reaction deletes the reaction
Got 0 failures and 2 other errors:
1.1) Failure/Error: raise error
Octokit::Unauthorized:
POST https://api.github.com/user/repos: 401 - Bad credentials // See: https://docs.github.com/rest
# ./lib/octokit/response/raise_error.rb:14:in `on_complete'
# ./lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
# ./lib/octokit/middleware/follow_redirects.rb:61:in `call'
# ./lib/octokit/connection.rb:156:in `request'
# ./lib/octokit/connection.rb:28:in `post'
# ./lib/octokit/client/repositories.rb:160:in `create_repository'
# ./spec/octokit/client/reactions_spec.rb:11:in `block (3 levels) in <top (required)>'
1.2) Failure/Error: @client.delete_repository(@repo.full_name)
NoMethodError:
undefined method `full_name' for nil:NilClass
# ./spec/octokit/client/reactions_spec.rb:15:in `block (3 levels) in <top (required)>' So the issue is not coming from my code (yet), my code has not even be executed by the test because I'm unable to create the |
I've spent a little while longer looking at this. I'm able to regenerate the spec file by setting the environment variable Doing this gives me some failure output:
Which appears to be relevant. Do you have thoughts on that? |
Yes, thank you so much @kfcampbell The second error was caused because I was creating another Both errors are fixed and all tests pass now 🙌 ==> Summary (12 workers in 9.3124s)
[ 1] 9 examples, 0 failures 1 suites in 2.4855s (pid 9391 exit 0 )
[ 2] 20 examples, 0 failures 1 suites in 9.3084s (pid 9392 exit 0 )
[ 3] 84 examples, 0 failures 8 suites in 9.3080s (pid 9393 exit 0 )
[ 4] 70 examples, 0 failures 8 suites in 9.3078s (pid 9394 exit 0 )
[ 5] 148 examples, 0 failures 6 suites in 9.3075s (pid 9395 exit 0 )
[ 6] 97 examples, 0 failures 5 suites in 9.3071s (pid 9396 exit 0 )
[ 7] 68 examples, 0 failures 8 suites in 9.3067s (pid 9397 exit 0 )
[ 8] 96 examples, 0 failures 6 suites in 9.3064s (pid 9398 exit 0 )
[ 9] 76 examples, 0 failures 9 suites in 9.3059s (pid 9399 exit 0 )
[10] 111 examples, 0 failures 5 suites in 9.3041s (pid 9400 exit 0 )
[11] 63 examples, 0 failures 8 suites in 9.3022s (pid 9401 exit 0 )
[12] 68 examples, 0 failures 8 suites in 9.3015s (pid 9402 exit 0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working through this @wJoenn!
Resolves #1633
Before the change?
After the change?
Client::Reactions
modulePull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
I'm having an issue trying to run the tests I've written.
I've exported a
OCTOKIT_TEST_GITHUB_TOKEN
with a new token I've created before forking the app (the token has all the rights I could give it) but despite doing that I get aOctokit::Unauthorized: POST https://api.github.com/user/repos: 401 - Bad credentials
error.I've tried another token that I use in my personal repos and it fails too so I don't think the issue comes from the tokens but probably from something I haven't set up proprelly.
Because of that I haven't been able to assert passing tests and complete coverage yet.
My set up process was to fork the repo then