beaker-project / beaker

Hardware integration testing system and lab automation for Fedora and RHEL
http://beaker-project.org/
GNU General Public License v2.0
80 stars 42 forks source link

WIP: swagger yaml defination #209

Open p3ck opened 10 months ago

p3ck commented 10 months ago

Using openapi 3.0 specification to define the restAPI for beaker backend.

skeleton api with some dummy methods to allow for testing the test framework.

Once this is fleshed out we can start migrating the model code over and then create the actual rest methods.

Created a test_systems unittest to make sure I understood how this would all glue together. pytest output:

================================================= test session starts =================================================
platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.3.0
rootdir: /home/bpeck/Sandbox/beaker/beaker/API
plugins: anyio-4.2.0
collected 4 items                                                                                                     

tests/test_api.py .                                                                                             [ 25%]
tests/test_systems.py ...                                                                                       [100%]

================================================== warnings summary ===================================================
============================================ 4 passed, 7 warnings in 0.10s ============================================

Alembic migrations will be handled by command line db-init and db-migrate tools.

JohnVillalovos commented 10 months ago

@p3ck This looks cool. Thanks!

Only thought I have is that at some point it would be good to add some CI to test this.

p3ck commented 10 months ago

@p3ck This looks cool. Thanks!

Only thought I have is that at some point it would be good to add some CI to test this.

Absolutely! You notice that I have the beginnings of tests in this PR. We will enable them in github when we switch over.

Lot more work to be done before then though.