-
Notifications
You must be signed in to change notification settings - Fork 97
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
More utility functions for the kernelci-core api helper #2378
Conversation
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 don't see anything obviously wrong, although this is a bit above my python skills...
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, not sure the linter error can be easily addressed
Additional change: Update the |
TODO: Update unit tests |
Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Allow it to take the node parameter either as a Node object, as a concrete Node submodel object or as a dict. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
This function is meant to be used by code issuing API requests (such as a pipeline service) to turn node dicts into objects with resolved references to linked nodes. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Since I don't think we can use use the mypy pydantic plugin (https://docs.pydantic.dev/latest/integrations/mypy/) unless we're using the latest version of pydantic, I set the recommended mypy flags from that page. The purpose is to fix certain wrong mypy assumptions over pydantic models that were causing the checks to fail for kernelci.api.helper. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Make this function create the regression from the two nodes that define the breaking point (the fail node and the previous pass node) and then submit it. This abstracts all the model details and the logic behind the regression generation away from the user code. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
688beee
to
395284a
Compare
Adapt the test and related mock to test the new submit_regression helper logic (regression generation and submission) against an expected result. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Do we still need this PR? |
is_test_suite()
: function to tell if a Test node represents a test case or a test suite, as we don't have this information in the models yetget_node_obj()
: returns a node dict as a proper object, optionally with resolved links to nodes also fetched as objects.