bluet / bluet/syspkg

Improve YUM test coverage for ListInstalled, Clean, and GetPackageInfo methods

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
testing
Dominant language
Go
Stars
17
Forks
8
PR merge metrics
No merged PRs in 30d

Description

## Problem Statement

YUM package manager has 0% test coverage for three critical methods:
- ListInstalled() - Currently 0% coverage
- Clean() - Currently 0% coverage
- GetPackageInfo() - Currently 0% coverage

## Current Test Coverage Status
From recent go test ./manager/yum -cover results:
- Overall YUM coverage: 69.4%
- Good coverage: enhancePackagesWithStatus (89.5%), Find (76.9%)
- Missing coverage: ListInstalled, Clean, GetPackageInfo (0% each)

## Acceptance Criteria
- [ ] Add comprehensive tests for ListInstalled() method
- [ ] Add comprehensive tests for Clean() method
- [ ] Add comprehensive tests for GetPackageInfo() method
- [ ] Use existing fixture-based testing patterns
- [ ] Follow testing philosophy: focus on behavior and contracts
- [ ] Maintain or improve overall YUM test coverage percentage
- [ ] All new tests pass in CI/CD pipeline

## Implementation Approach
1. Use existing patterns: Follow established fixture-based testing in behavior_test.go
2. Leverage CommandRunner mocking: Use MockCommandRunner for unit tests
3. Real fixture data: Use authentic YUM command outputs from testing/fixtures/yum/
4. Cross-platform testing: Ensure tests work in Docker environments

## Test Strategy
- ListInstalled: Test parsing of yum list installed output with various package states
- Clean: Test cache cleanup operations and output parsing
- GetPackageInfo: Test detailed package information retrieval and parsing

## Priority
High Priority - These are core YUM operations that need test coverage for reliability and maintainability.

## Related Issues
- Part of overall test coverage improvement initiative
- Follows CommandRunner architecture established in Issue #20
- Uses patterns proven successful in APT package manager testing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.