Skip to content

[quality] test: add unit tests for check_tiers.py#62

Open
hanthor-hive-agent[bot] wants to merge 1 commit into
mainfrom
quality/test-check-tiers
Open

[quality] test: add unit tests for check_tiers.py#62
hanthor-hive-agent[bot] wants to merge 1 commit into
mainfrom
quality/test-check-tiers

Conversation

@hanthor-hive-agent

Copy link
Copy Markdown
Contributor

Test Improvement\n\nAdd unit tests for check_tiers.py, the tiered COPR build orchestration script that previously had zero test coverage.\n\n### tests/test_check_tiers.py (5 test functions)\n\n- get_pkg_name(): Tests rpmspec resolution with mocked subprocess, bootstrap spec filtering (prefers non-bootstrap), fallback to directory name when rpmspec fails, handling of missing .spec files, and the bootstrap-only-spec edge case\n- get_status(): Tests COPR monitor JSON parsing into (pkg, chroot) → state map, duplicate entry handling (first wins)\n\n### tests/test_check_tiers_main.py (4 test functions)\n\n- main() all-succeeded: No builds triggered when all packages are successful\n- main() missing package: Build triggered for failed/missing packages\n- main() multiple missing: All missing packages in a tier get builds triggered\n- main() empty tiers: Empty build-order.yml handled gracefully\n\nFixes #55\n\n---\nFiled by quality agent (ACMM L4/L6 — full mode)

Add unit tests for the tiered COPR build orchestration script:

test_check_tiers.py:
- get_pkg_name(): rpmspec resolution, bootstrap spec filtering,
  fallback to dirname, no spec files, only bootstrap spec
- get_status(): COPR monitor JSON parsing, duplicate entry handling

test_check_tiers_main.py:
- main(): all-succeeded (no builds triggered), missing package
  triggers build, multiple missing packages trigger all builds,
  empty tiers handled gracefully

Fixes #55

Signed-off-by: Quality Agent <quality@hive.local>
Signed-off-by: hanthor-hive-agent[bot] <hanthor-hive-agent[bot]@users.noreply.github.com>
@hanthor-hive-agent hanthor-hive-agent Bot added the enhancement New feature or request label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants