-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix: register custom config model #189
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #189 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 978 984 +6
=========================================
+ Hits 978 984 +6 ☔ View full report in Codecov by Sentry. |
@uniqueg I couldn't figure out on how to add tests for this specific change as it is just reading the model field from the config and converting it to an absolute path. I have tested this by manually passing model from cloud-registry and it is working fine. |
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 is a very elegant fix, thanks a lot
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 have just seen the comment about the tests. I guess you could simply test it by instantiating the model with None
, with a relative path, with an absolute path and with an invalid/non-existing path.
If you can add those tests and they pass, you can just go ahead and merge it. I don't think there will be a need for another review.
If you still have trouble writing the tests, just text in the #foca channel on Slack and I'll help you :)
Hey @uniqueg can you please review the PR again, I was not confident if I was adding tests the correct way :) |
Description
This PR fixes the bug where foca did not register a custom config model which is passed in the input config if the api specs were not provided.
In addition, the validator for model path also converts the relative path passed in the config.yaml to the absolute path because casbin is not able to resolve relative path directly.
Fixes #181
Type of change