Skip to content

tests: Add tests for ciq-cherry-pick.py functions - #85

Open
PlaidCat wants to merge 1 commit into
mainlinefrom
{jmaple}_ciq-cherry-pick-testing
Open

tests: Add tests for ciq-cherry-pick.py functions#85
PlaidCat wants to merge 1 commit into
mainlinefrom
{jmaple}_ciq-cherry-pick-testing

Conversation

@PlaidCat

@PlaidCat PlaidCat commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Claude Generated based on me telling it where to look for examples of previous successful ciq-cherry-pick invocations.

Import the script via importlib against temporary git repos to test the actual functions: extract_cve_from_tag, manage_commit_message, cherry_pick (full integration with real git cherry-pick), check_fixes, and update_jira_success/failure. Test fixtures use commit data modeled after real ciqlts9_6 backports (drm/xe, KVM, net/sched, nfsd, proc).

Coverage Report

Name Stmts Miss Branch BrPart Cover Missing
check_fips_changes.py 42 42 12 0 0% 8-67
check_kernel_commits.py 179 179 76 0 0% 3-371
ciq-cherry-pick.py 194 100 54 3 49% 48-50, 55-90, 130, 173, 179-180, 201-202, 224-225, 240-242, 262-271, 294-331, 335-434
ciq-tag.py 146 146 16 0 0% 3-378
ciq_tag.py 232 232 54 0 0% 1-464
jira_pr_check.py 180 180 80 0 0% 3-381
kt/ktlib/ciq_helpers.py 325 230 152 6 26% 31-51, 74-106, 126->129, 136->151, 169-171, 242-243, 247, 252, 277-314, 327-333, 346-347, 351-353, 359, 380-382, 390-395, 404-406, 415-420, 431-444, 455-479, 489-503, 513-518, 527, 557-623, 632-642, 646-655, 665-680, 692-709
kt/ktlib/command_runner.py 33 20 6 0 33% 16, 20-33, 37-61, 65-66
kt/ktlib/config.py 59 0 16 0 100%
kt/ktlib/jira.py 148 119 32 0 16% 19-27, 39-55, 58-61, 64-68, 71-74, 77-80, 83-88, 91-98, 101-121, 124-131, 134-138, 142-157, 161-164, 171-184, 187-190, 193-209, 212-219, 222-224
kt/ktlib/kernel_workspace.py 147 50 28 2 62% 24, 100, 141-143, 148-150, 153-159, 172-183, 194-204, 221-224, 228-263
kt/ktlib/kernels.py 96 13 20 1 86% 77-85, 139, 155-162
kt/ktlib/local.py 5 1 0 0 80% 12
kt/ktlib/repo.py 29 15 2 0 45% 30-31, 34-35, 43-55
kt/ktlib/ssh.py 12 5 2 0 50% 9-12, 16
kt/ktlib/util.py 17 0 0 0 100%
kt/ktlib/virt.py 80 39 10 0 46% 26, 34-37, 51-78, 82-88, 92-93, 97, 101, 105, 109, 119-127, 133-138, 142-147
kt/ktlib/vm.py 302 152 52 4 47% 127-144, 177-186, 194-205, 234-238, 253->264, 281->287, 292-302, 305-306, 319-323, 326, 329-345, 350-367, 370-377, 386-392, 400-405, 426-437, 440-441, 444, 448-453, 465-478, 491-498, 507, 516-528, 531-538, 541-550, 553
release_config.py 2 2 0 0 0% 7-27
rolling-release-update.py 264 264 106 0 0% 1-412
run_interdiff.py 165 165 56 0 0% 3-244
update_lt_spec.py 219 219 46 0 0% 9-411
TOTAL 2876 2173 820 16 22%

Import the script via importlib against temporary git repos to test
the actual functions: extract_cve_from_tag, manage_commit_message,
cherry_pick (full integration with real git cherry-pick), check_fixes,
and update_jira_success/failure. Test fixtures use commit data modeled
after real ciqlts9_6 backports (drm/xe, KVM, net/sched, nfsd, proc).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PlaidCat PlaidCat self-assigned this Aug 14, 2026
Copilot AI lite review requested due to automatic review settings August 14, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a comprehensive pytest suite for ciq-cherry-pick.py, exercising the script’s core behaviors against real temporary git repositories to validate message standardization, Fixes: handling, cherry-pick integration (including conflicts), and Jira update helpers.

Changes:

  • Introduces an importlib-based fixture to load ciq-cherry-pick.py inside an isolated temporary git repo environment.
  • Adds unit tests for extract_cve_from_tag, manage_commit_message, and check_fixes.
  • Adds integration-style tests for cherry_pick (success, conflict, and no-tag cases) plus tests for update_jira_success / update_jira_failure.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +40 to +45
if "ciq_cherry_pick" in sys.modules:
del sys.modules["ciq_cherry_pick"]
spec = importlib.util.spec_from_file_location("ciq_cherry_pick", SCRIPT_PATH)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants