-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add endpoint to set spares definition #413 #421
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #421 +/- ##
===========================================
+ Coverage 97.87% 97.92% +0.05%
===========================================
Files 41 45 +4
Lines 1504 1592 +88
===========================================
+ Hits 1472 1559 +87
- Misses 32 33 +1 ☔ View full report in Codecov by Sentry. |
…d add an e2e test #431
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.
Looks Good overall, and seems to work well. Have some minor changes/comments on the implementation, testing is good except for a small typo.
SettingInBaseT = TypeVar("SettingInBaseT", bound=SettingInBase) | ||
SettingOutBaseT = TypeVar("SettingOutBaseT", bound=SettingOutBase) |
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.
SettingInBaseT = TypeVar("SettingInBaseT", bound=SettingInBase) | |
SettingOutBaseT = TypeVar("SettingOutBaseT", bound=SettingOutBase) | |
SettingInBaseT = TypeVar("SettingInBaseT", bound=SettingInBase) | |
SettingOutBaseT = TypeVar("SettingOutBaseT", bound=Union[SettingOutBase, SettingInBaseT]) |
I think this should ensure that SettingOutBaseT is the same settings as the InBase (i.e Would not include SparesDefinitionIn and ExpiryDefinitionOut), but again it runs fine as it is without errors, so similar to the last comment.
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 think having the union here would actually mean it can be any subtype of SettingOutBase or SettingInBase (https://stackoverflow.com/questions/59933946/difference-between-typevart-a-b-and-typevart-bound-uniona-b). I don't think there is a way to have them coupled like that unfortunately.
Yes codecov is correct as it excludes e2e tests in its coverage checking. We have generally ignored unit testing validation in the schemas in unit tests due to them usually being created inside the router level when a request is made, so without adding a test file for schemas it makes sense to use the e2e tests to validate them instead but as a consequence they are left untested in unit tests and so show up on the coverage e.g. https://app.codecov.io/gh/ral-facilities/inventory-management-system-api/pull/421/blob/inventory_management_system_api/schemas/catalogue_category.py. |
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.
Looks good overall, just some more final minor changes.
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.
LGTM!
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.
Works well, just some minor things.
Description
See #413. Went with the aggregate query approach as an experiment, we could equally just loop though and insert the values. There is no need to insert all usage status fields as I have done at the moment.
Notes
setup
fixtures when inheriting so renamed all in e2e tests to be consistentusage_status_value_id_dict
in catalogue category's create dsl, it is now populated in the usage status create dsl to avoid repeating in cases like thisTesting instructions
Add a set up instructions describing how the reviewer should test the code
Agile board tracking
Closes #413, relates to #90