Skip to content

test: add comprehensive tests for testutil package#44

Merged
mrhillsman merged 1 commit into
mainfrom
test/add-testutil-tests
May 21, 2026
Merged

test: add comprehensive tests for testutil package#44
mrhillsman merged 1 commit into
mainfrom
test/add-testutil-tests

Conversation

@mrhillsman

Copy link
Copy Markdown
Contributor

Add unit tests for testutil.go and binary.go functions:

  • UniqueNamespace: validates format and uniqueness
  • ManagedLabels: verifies label keys and values
  • DefaultVMOpts: tests all default VM configuration fields
  • BinaryPath: tests env var fallback and build caching
  • RunVirtwork: validates CLI execution with various arguments

Add integration tests for cluster-dependent functions:

  • MustConnect: tests cluster connection and panic behavior
  • EnsureTestNamespace: validates namespace creation with labels
  • CleanupNamespace: verifies graceful cleanup handling
  • WaitForVMRunning: tests timeout behavior

Integration tests use //go:build integration tag and require a live cluster. Unit tests achieve 58.2% code coverage.

Fixes #14

@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 20, 2026
@mrhillsman
mrhillsman force-pushed the test/add-testutil-tests branch 2 times, most recently from 291e034 to 1a3dc12 Compare May 21, 2026 22:32
Add unit tests for testutil.go and binary.go functions:
- UniqueNamespace: validates format and uniqueness
- ManagedLabels: verifies label keys and values
- DefaultVMOpts: tests all default VM configuration fields
- BinaryPath: tests env var fallback and build caching
- RunVirtwork: validates CLI execution with various arguments

Add integration tests for cluster-dependent functions:
- MustConnect: tests cluster connection and panic behavior
- EnsureTestNamespace: validates namespace creation with labels
- CleanupNamespace: verifies graceful cleanup handling
- WaitForVMRunning: tests timeout behavior

Integration tests use //go:build integration tag and require
a live cluster. Unit tests achieve 58.2% code coverage.

Fixes #14

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
@mrhillsman
mrhillsman force-pushed the test/add-testutil-tests branch from 1a3dc12 to a6bd805 Compare May 21, 2026 23:03
@mrhillsman
mrhillsman merged commit e502717 into main May 21, 2026
3 of 4 checks passed
@mrhillsman
mrhillsman deleted the test/add-testutil-tests branch May 22, 2026 06:46
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.

[Bug]: testutil package has no tests

1 participant