-
Notifications
You must be signed in to change notification settings - Fork 2.2k
test: Simplify the function that skips integration tests #3752
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
test: Simplify the function that skips integration tests #3752
Conversation
556c8f1
to
c22f639
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3752 +/- ##
=======================================
Coverage 91.11% 91.11%
=======================================
Files 187 187
Lines 16702 16702
=======================================
Hits 15218 15218
Misses 1296 1296
Partials 188 188 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c22f639
to
9c77662
Compare
if *meta.VerifiablePasswordAuthentication { | ||
t.Error("APIMeta VerifiablePasswordAuthentication is true") |
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.
What's the story with the complete reversal on this one?
Do we need to add a comment? Or was it just plain broken?
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.
verifiable_password_authentication
is false
for github.com
since February 14, 2020. So yeah, the test seems broken for 4.5 years.
I found this information on:
- https://developer.github.com/changes/2020-02-14-deprecating-password-auth/
- https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/
- GitHub Desktop authentication primarily through browser flow desktop/desktop#9231
- https://docs2.lfe.io/v3/meta/#:~:text=GitHub%20Enterprise%20instances%20using%20CAS%20or%20OAuth%20for%20authentication%20will%20return%20false
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.
@gmlewis I can remove this check at all:
if *meta.VerifiablePasswordAuthentication {
t.Error("APIMeta VerifiablePasswordAuthentication is true")
}
The test will still be valuable.
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.
That's OK. We can leave it as it will be good-to-know for people who were not aware of the change in 2020.
Thank you, @alexandear!
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.
Thank you, @alexandear!
LGTM.
Merging.
This PR refactors integration tests:
checkAuth
function in by passing*testing.T
parameter and renaming for clarity.client
andauth
initialization by usingsync.OnceValues
.TestAPIMeta
which fails if run without OAuth token.Running integration tests locally
TestAPIMeta
without token:TestAPIMeta
with token:All tests without token: