-
Notifications
You must be signed in to change notification settings - Fork 37
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 coverage for auth configuration #3285
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
It looks like some of the tests are failing |
Hmm, it's because we're not logged in to Azure for the unit tests. As it should be, really. But without logging in, we can't test CLI functionality. Adding the |
It blurs the lines a little between unit tests and integration tests a little but think that's probably a reasonable change for now to get it into CI. Perhaps it should be disabled by default by a flag or something so that locally just the unit tests (without external dependencies) are run by default. |
Would it be hard to refactor the method to allow mocking of the Azure CLI dependency to turn these tests into pure unit tests of our code? |
The call out to |
9a9d557
to
927e535
Compare
Could we mock it out? Define an interface, pass the real implementation in the provider, pass a stub in the test, and only test our code (like the error logic that you added)? |
I don't see mocking as a good fit here. Like I said, most of the logic is in the dependency and the Also, this whole issue is an aside I picked up from triage and I'm not planning to spend time for larger refactorings on it. |
f27deb6
to
17ba847
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3285 +/- ##
=======================================
Coverage 55.35% 55.35%
=======================================
Files 66 66
Lines 9934 9934
=======================================
Hits 5499 5499
Misses 4001 4001
Partials 434 434 ☔ View full report in Codecov by Sentry. |
17ba847
to
4a1870c
Compare
This is a core part of the provider that lacked coverage. Also includes the new #3281.