Skip to content

Conversation

@t-persson
Copy link
Collaborator

@t-persson t-persson commented Nov 2, 2020

Applicable Issues

fixes: eiffel-community/etos#29

Description of the Change

Make use of pydantic models to do this validation.
Since we are going to move over to FastAPI and pydantic,
this is not a bad move.
Also added tests for this new library

Alternate Designs

We could opt out of pydantic and use jsonschema instead.
I decided to use pydantic because I see us using FastAPI and pydantic in the future to restructure this API.

Benefits

Fail faster

Possible Drawbacks

This validator must be updated whenever a change in the test definition is made.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Tobias Persson tobias.persson@axis.com

Make use of pydantic models to do this validation.
Since we are going to move over to FastAPI and pydantic,
this is not a bad move.
Also added tests for this new library
@t-persson t-persson requested a review from a team as a code owner November 2, 2020 08:07
@t-persson t-persson requested review from andjoe-axis and fredjn and removed request for a team November 2, 2020 08:07
Added a clearer docstring.
Added raises, input parameter and return value documentation
@t-persson t-persson requested a review from fredjn November 3, 2020 08:21
Copy link
Contributor

@andjoe-axis andjoe-axis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@fredjn fredjn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@t-persson t-persson merged commit b5d683a into eiffel-community:master Nov 3, 2020
@t-persson t-persson deleted the test_suite_validation branch November 3, 2020 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback when user provides a broken suite definition

3 participants