-
Notifications
You must be signed in to change notification settings - Fork 41
patina: test: Add test on event callback support #927
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
Merged
Javagedes
merged 5 commits into
OpenDevicePartnership:main
from
Javagedes:personal/joeyvagedes/patina-test
Nov 19, 2025
Merged
patina: test: Add test on event callback support #927
Javagedes
merged 5 commits into
OpenDevicePartnership:main
from
Javagedes:personal/joeyvagedes/patina-test
Nov 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1b7c4b4 to
5f4636e
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
os-d
approved these changes
Oct 19, 2025
5f4636e to
96141a9
Compare
Contributor
Author
Contributor
|
@cfernald @makubacki this PR is now ready for review (although @Javagedes you'll need to rebase it). Can you please help review? |
cfernald
approved these changes
Nov 19, 2025
96141a9 to
9556fca
Compare
730f0b7 to
dedf9f9
Compare
adds a new attribute for the `#[patina_test]` attribute macro that allows the user to specify a UEFI event that the test should be executed on. When the UEFI event callback is fired, the patina_test will be executed. This new attribute is `#[on(protocol = <REAL_GUID>)]` e.g. `#[on(protocol = r_efi::efi::EVENT_GROUP_READY_TO_BOOT)]`. After this change, not all patina_tests are executed immediately during the `TestRunner` component. Due To this, test result reporting is delayed to two separate event callbacks. Test results are now reported once at READY_TO_BOOT and once at EXIT_BOOT_SERVICES. Additionally, this change introduces a optional callback that the platform can register, that is executed anytime a test fails. Example Test reporting: INFO - INFO - Patina on-system unit-test results: INFO - patina_adv_logger::integration_test::adv_logger_test ... ok (1 passes) INFO - patina_dxe_core::memory_manager::memory_manager_allocations_test ... ok (1 passes) INFO - patina_dxe_core::memory_manager::memory_manager_attributes_test ... ok (1 passes) INFO - qemu_q35_dxe_core::my_test ... ok (413 passes) INFO - qemu_q35_dxe_core::ready_to_boot_test ... ok (1 passes)
74a6804 to
68487d8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please Note: This PR is finished, and ready for review, however this is marked as draft, as some tests are disabled until RFC 0017 is completed.
Description
adds a new attribute for the
#[patina_test]attribute macro that allows the user to specify a UEFI event that the test should be executed on. When the UEFI event callback is fired, the patina_test will be executed.This new attribute is
#[on(event= <REAL_GUID>)]e.g.#[on(event = r_efi::efi::EVENT_GROUP_READY_TO_BOOT)].After this change, not all patina_tests are executed immediately during the
TestRunnercomponent. Due To this, test result reporting is delayed to two separate event callbacks. Test results are now reported once at READY_TO_BOOT and once at EXIT_BOOT_SERVICES.The
fail_fastconfig feature has been removed. This is because not all tests happen within the control of theTestRunnercomponent, and thus cannot fail if it wanted to. Instead, an optional callback can be registered by the platform to handle an error however the platform prefers, that is executed anytime a test fails.Example Test reporting:
How This Was Tested
Boot to QEMUQ35 with various tests that use the event callback logic.
Integration Instructions
fail_faste.g.fail_fast(...). Replace with custom error handling when a patina test fails with.with_callback(fn(&'static str, &'static str))