-
Notifications
You must be signed in to change notification settings - Fork 83
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
Connection flatten functions to return diagnostics slice instead of error (2/3) #240
Conversation
|
||
import "testing" | ||
|
||
func TestFlattenConnectionOptions(t *testing.T) { |
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.
I always wondered why we didn't unit test the flatten function because there is quite a bit of logic and complexity wrapped up in them. However, this test is just asserting the simple case of a nil
options struct which should return nil
.
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.
This file will also serve as the holding place to test the existence of specific diagnostic information like warnings.
d73739e
to
da61912
Compare
Codecov Report
@@ Coverage Diff @@
## main #240 +/- ##
==========================================
+ Coverage 82.64% 82.67% +0.02%
==========================================
Files 36 36
Lines 6850 6861 +11
==========================================
+ Hits 5661 5672 +11
Misses 938 938
Partials 251 251
Continue to review full report at Codecov.
|
da61912
to
e53edb4
Compare
Description
Small refactor of the connection resource's flatten functions to return
diag.Diagnostics
instead of a regular error. What this does is allow more specific diagnostic logging to exist alongside the domain-specific code. Otherwise, we would need to maintain some type of mapping between a custom error type and the diagnostic logs within the higher-level flatten function. This unlock is demonstrated in this PR: #241 .Checklist
Note: Checklist required to be completed before a PR is considered to be reviewable.
Auth0 Code of Conduct
Auth0 General Contribution Guidelines
Changes include test coverage?
Does the description provide the correct amount of context?
Have you updated the documentation?
Is this code ready for production?