Skip to content

refactor(cmd/virtwork): remove duplicate and misplaced tests#149

Merged
mrhillsman merged 2 commits into
mainfrom
refactor/trim-duplicate-cmd-tests
May 30, 2026
Merged

refactor(cmd/virtwork): remove duplicate and misplaced tests#149
mrhillsman merged 2 commits into
mainfrom
refactor/trim-duplicate-cmd-tests

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Delete cmdstructure_test.go (flag-existence checks duplicated by main_test.go value-based flag tests and implicitly by rune/cleanupe tests) and print_test.go (thin formatting wrappers already exercised through cleanupe_test.go dry-run paths).

Trim main_test.go by removing seven Describe blocks that tested internal/ package functions directly (vm.BuildVMSpec, resources. EnsureNamespace, cleanup.CleanupAll, workloads registry, config pointer semantics) rather than cmd wiring — these are already covered by their respective package test suites.

Removes 794 lines with no change to coverage (85.5%).

Delete cmdstructure_test.go (flag-existence checks duplicated by
main_test.go value-based flag tests and implicitly by rune/cleanupe
tests) and print_test.go (thin formatting wrappers already exercised
through cleanupe_test.go dry-run paths).

Trim main_test.go by removing seven Describe blocks that tested
internal/ package functions directly (vm.BuildVMSpec, resources.
EnsureNamespace, cleanup.CleanupAll, workloads registry, config
pointer semantics) rather than cmd wiring — these are already
covered by their respective package test suites.

Removes 794 lines with no change to coverage (85.5%).

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@exe-prow-github-app exe-prow-github-app Bot requested a review from OchiengEd May 30, 2026 07:21
@exe-prow-github-app

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrhillsman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2026
The tests used /nonexistent/deeply/nested/path which can succeed on
systems where the process has permission to create directories at /.
Switch to /dev/null/impossible/ which always fails because /dev/null
is a device file, not a directory.

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@mrhillsman mrhillsman removed the request for review from OchiengEd May 30, 2026 07:34
@mrhillsman mrhillsman merged commit 000747a into main May 30, 2026
3 of 4 checks passed
@mrhillsman mrhillsman deleted the refactor/trim-duplicate-cmd-tests branch May 31, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant