test: Simplify the function that skips integration tests#3752
test: Simplify the function that skips integration tests#3752gmlewis merged 1 commit intogoogle:masterfrom
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.
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.
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.
@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.
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!
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @alexandear!
LGTM.
Merging.
This PR refactors integration tests:
checkAuthfunction in by passing*testing.Tparameter and renaming for clarity.clientandauthinitialization by usingsync.OnceValues.TestAPIMetawhich fails if run without OAuth token.Running integration tests locally
TestAPIMetawithout token:TestAPIMetawith token:All tests without token: