- Notifications
You must be signed in to change notification settings - Fork935
Remove test that can panic#445
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Remove test that can panic#445
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
"path": []string{"src"}, | ||
}, | ||
expectedResult: nil, | ||
expectError: "no repository resource content found", |
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.
Also, thisexpectError
field is never actually used because all the tests setexpectedErrorMsg
.
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.
7e026fc
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
This PR removes a test that was both trying to simulate an error that can't happen, and causing bizarre failures elsewhere. For example, when another test failed (simulated with a
t.FailNow
inTest_GetMe
, it would also get this panic:This is because:
Was registering a handler with no responses which would then panic here when a request came in:https://github.com/migueleliasweb/go-github-mock/blob/dd6b28752862d0748bf5cee28fc1d69b0475eb3f/src/mock/server.go#L40-L45
Unfortunately, this panic would never bubble up a test failure in this test, but presumably because it was in a goroutine, would asynchronously result in strange failures in other places. Haven't totally dug into why because it's not that important beyond fixing it.