sclorg / testing-farm-as-github-action

GitHub Action to execute tests by Testing Farm and update Pull Request status
MIT License
13 stars 11 forks source link

Add support for user specific hardware and disk #146

Closed phracek closed 5 months ago

phracek commented 5 months ago

Add support for user specific hardware.

In case hardware is properly specified as JSON string, like '{"memory": ">= 8 GB"}', then new method called api.unsafeNewRequest is called.

In case hardware is not specified or it is proper JSON format then api.newRequest is called as before.

action.yml is updated with support 'hardware' option.

For more information about hardware support see https://tmt.readthedocs.io/en/latest/spec/hardware.html

Tests added for this pull request are: test/action.test.ts: 'Hardware test', and 'Hardware test - wrong JSON' test/unit/unit.test.ts: tests for isJsonString

Signed-off-by: Petr "Stone" Hracek phracek@redhat.com

For more information see: https://gitlab.com/testing-farm/docs/root/-/merge_requests/120/diffs?view=inline https://api.testing-farm.io/redoc#operation/request_a_new_test_v0_1_requests_post

phracek commented 5 months ago

This pull request is blocked by https://github.com/redhat-plumbers-in-action/testing-farm/pull/111

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.31%. Comparing base (e7e67b9) to head (fa2fe1c).

:exclamation: Current head fa2fe1c differs from pull request most recent head 902ac24. Consider uploading reports for the commit 902ac24 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #146 +/- ## ========================================== + Coverage 99.29% 99.31% +0.02% ========================================== Files 8 8 Lines 566 584 +18 Branches 60 67 +7 ========================================== + Hits 562 580 +18 Misses 4 4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

phracek commented 5 months ago

@zmiklank @jamacku Review is welcome. Tests are passing.

[test]

phracek commented 5 months ago

https://github.com/rhinstaller/kickstart-tests/pull/1122 just for tracking.

zmiklank commented 5 months ago

@phracek Thanks for the contribution, I did not do a review, I believe jamacku will cover everything needed. But as I mentioned I am linking our integration tests. Feel free to add some to cover this new feature too. You can take an inspiration for example from github summary test and its tmt plan.

phracek commented 5 months ago

[test]

phracek commented 5 months ago

Added distribution sources

[test]

phracek commented 5 months ago

Please also add assert to the minimal integration test that unsafeNewRequest wasn't called

fixed by https://github.com/sclorg/testing-farm-as-github-action/pull/146/commits/2221ad003a011947ed40f5e295df89e689fc3657. Thanks