Skip to content

Conversation

@ckyrouac
Copy link
Collaborator

@ckyrouac ckyrouac commented Jun 3, 2025

This adds a few basic integration tests for system-reinstall-bootc, adds a system-reinstall option to tests-integration to run them, and executes them as part of the github action.

@ckyrouac ckyrouac requested a review from Copilot June 3, 2025 14:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new set of integration tests for the system-reinstall-bootc functionality. The key changes include:

  • Introducing a new enum variant (SystemReinstall) and corresponding test module (system_reinstall.rs) to handle system-reinstall-bootc tests.
  • Updating supporting modules (install.rs), documentation (README.md), Cargo.toml, and the CI workflow (ci.yml) to integrate these tests.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests-integration/src/tests-integration.rs Integrates the new SystemReinstall variant into the test CLI interface.
tests-integration/src/system_reinstall.rs Implements two integration tests for system-reinstall-bootc functionality.
tests-integration/src/install.rs Exposes helper functions used by both system-reinstall and install tests.
tests-integration/README.md Updates documentation with a section for system-reinstall tests.
tests-integration/Cargo.toml Adds the rexpect dependency required for system-reinstall testing.
.github/workflows/ci.yml Adds a CI step to run system-reinstall tests.
Comments suppressed due to low confidence (1)

tests-integration/src/system_reinstall.rs:24

  • [nitpick] Consider providing a more detailed error message or handling cases with multiple deployment directories if that situation might occur in practice.
assert_eq!(entries.len(), 1, "Expected exactly one deployment directory");

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable set of integration tests for the system-reinstall-bootc functionality. The tests cover the default behavior and a disk space check scenario, utilizing rexpect for PTY interaction, which is appropriate for this kind of CLI testing. The changes to existing files to make functions pub(crate) for reusability are logical.

Overall, the additions are well-structured and enhance the test coverage significantly. I've identified a couple of areas where the robustness of the tests could be improved, detailed in the comments below. No style guide was explicitly provided, so feedback is based on general Rust best practices and idiomatic code.

Summary of Findings

  • Fragile df output parsing: The test disk space check parses df output using fixed line and field indices, which could be brittle if df output format varies. This was commented on with medium severity.
  • Overly permissive regex in PTY expectation: The regex used to match the podman command in system-reinstall-bootc output uses (.*) for a temporary filename, which is less specific than it could be. This was commented on with medium severity.
  • Cargo.toml dependency sorting (tests-integration): In tests-integration/Cargo.toml, the newly added rexpect dependency is not alphabetically sorted with other dependencies. This is a minor style issue (low severity) and was not commented on directly due to review settings.

Merge Readiness

The pull request is a good step towards comprehensive testing for system-reinstall-bootc. However, there are a couple of medium severity issues identified related to the robustness of test assertions (parsing df output and regex specificity). It's recommended to address these points to improve test stability before merging.

As an AI, I am not authorized to approve pull requests. Please ensure further review and approval from authorized maintainers.

@ckyrouac ckyrouac force-pushed the system-reinstall-integration branch 4 times, most recently from 3b277db to 90cd81b Compare June 3, 2025 17:30
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Nice! I just have some minor nits.

I've been thinking a lot about CI lately and our sprawl around different systems BTW, right now it's a bit annoying to replicate the things we have triggered via GHA outside of it. Totally good as is, just noting.

This adds a few basic integration tests for system-reinstall-bootc, adds
a system-reinstall option to tests-integration to run them, and executes
them as part of the github action.

Signed-off-by: ckyrouac <[email protected]>
@ckyrouac ckyrouac force-pushed the system-reinstall-integration branch from 90cd81b to 72c3c74 Compare June 5, 2025 14:57
@ckyrouac ckyrouac merged commit 9d15eed into bootc-dev:main Jun 5, 2025
34 checks passed
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.

2 participants