Skip to content

[quality] test: unit coverage for offline_boot_steps.py, sudo_rs_steps.py, bctl_steps.py, update_failure_steps.py - #768

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-uncovered-behave-step-modules
Open

[quality] test: unit coverage for offline_boot_steps.py, sudo_rs_steps.py, bctl_steps.py, update_failure_steps.py#768
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-uncovered-behave-step-modules

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds pytest unit coverage for the four behave step modules in this repo that had no tests/unit/ counterpart. Claimed ground, exactly:

New test file Module under test Functions covered
tests/unit/test_offline_boot_steps.py tests/smoke/features/steps/offline_boot_steps.py _run_host, nm_wait_online_not_before_graphical, uupd_timer_enabled_or_absent, no_uupd_error_journal_entries, drop_default_route, restore_default_route, boot_with_interfaces_down
tests/unit/test_sudo_rs_steps.py tests/smoke/features/steps/sudo_rs_steps.py sudo_is_setuid_root_4755, sudo_n_id_u_returns_0, sudo_preserve_env_check, sudo_pam_includes_system_auth, sudoedit_binary_check
tests/unit/test_bctl_steps.py tests/developer/features/steps/bctl_steps.py _terminal_widget, _terminal_delta, _wait_for_command_result, run_bctl_command_in_ptyxis, bctl_command_output_includes, bctl_command_exits_with_status_zero, bctl_update_check_exits_with_status_zero_or_one
tests/unit/test_update_failure_steps.py tests/lifecycle/features/steps/update_failure_steps.py _parse_bootc_status, _skip, bootc_rollback_matches_original, force_bootc_rollback_and_reboot, and the four @pending greenboot/corrupted-digest stubs

83 new tests. Line coverage for those four modules: 0% -> 99% (only the reboot-disconnect except body is unreached).

Each test file stubs behave, dogtail.rawinput, qecore.common_steps and tests.shared.ssh_steps in sys.modules, following the existing tests/unit/test_xwayland_steps.py and tests/unit/test_lifecycle_steps.py import-helper pattern. No VM, SSH transport or desktop session is required.

Scope / disjointness

Test-only change. Adds four new files, modifies nothing. No Justfile, workflow or production-code edits — pytest already auto-discovers tests/unit/.

Verified disjoint from every open testsuite PR:

Verification

python3 -m pytest tests/unit/ -q
1407 passed in 140.92s

Full existing suite still green — the sys.modules stubbing does not leak into other unit tests.

Related Issue

Refs #767 (CI gate script coverage tracker) — this PR covers behave step modules, not the CI gate scripts, so the tracker stays open.


Filed by quality agent (hold-gated mode). Human review required. Do not merge without review; hold label must stay.

— hive: agent=quality backend=copilot model=claude-opus-5

Adds pytest unit coverage for the four behave step modules in this repo
that had no corresponding tests/unit/ file:

- tests/smoke/features/steps/offline_boot_steps.py
- tests/smoke/features/steps/sudo_rs_steps.py
- tests/developer/features/steps/bctl_steps.py
- tests/lifecycle/features/steps/update_failure_steps.py

Each new test file stubs behave, dogtail, qecore and the SSH transport in
sys.modules so no VM or desktop session is required, following the existing
tests/unit/test_xwayland_steps.py and test_lifecycle_steps.py pattern.

Line coverage for the four modules goes from 0% to 99%.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added hold Work is intentionally paused. quality testing agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-projectbluefin-knuckle-gjvq Approved by a Hive merger/owner for auto-merge on green CI labels Aug 29, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

83 tests across 4 new files for previously-uncovered step modules; spot-checked against real assertion text, exercises real branches. CI green (1407 passed).


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-projectbluefin-knuckle-gjvq Approved by a Hive merger/owner for auto-merge on green CI hold Work is intentionally paused. quality testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants