itest: Add reusable integration test library crate#231
Open
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Open
itest: Add reusable integration test library crate#231cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
The pull request introduces a new itest crate for integration testing, featuring automatic test registration, privilege tiers with VM dispatch, and JUnit XML output. The itest crate provides macros for registering tests and supports running tests that require root privileges by dispatching them to a bcvk VM. Review comments suggest improving the error message in the test harness, using a more robust method for creating test name suffixes, and addressing a potential panic in the privilege dispatch logic.
| let outcome = TestOutcome { | ||
| name, | ||
| duration, | ||
| result: result.as_ref().map(|_| ()).map_err(|e| format!("{e:?}")), |
There was a problem hiding this comment.
Comment on lines
+192
to
+193
| pub fn image_to_test_suffix(image: &str) -> String { | ||
| image.replace(|c: char| !c.is_alphanumeric(), "_") |
|
Thanks @cgwalters!! |
d2a944a to
7d58ca1
Compare
We were growing too much duplication between projects around integration tests. Extract a shared helper library that we'll vendor via git crate dependencies. Assisted-by: OpenCode (Claude Opus 4.6) Signed-off-by: Colin Walters <walters@verbum.org>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Extract the test infrastructure pattern shared across bcvk, ostree, composefs-rs, and bootc into a standalone library crate. This follows the direction outlined in bootc-dev/infra repository-structure.md to reduce code duplication for integration testing.
The crate provides:
The integration-tests crate is updated to use itest instead of its own hand-rolled infrastructure. Test function return types are migrated from color_eyre::Result to anyhow::Result to align with the library standard (the tests never used color_eyre-specific features).
Assisted-by: OpenCode (Claude Opus 4.6)