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

@PlaidCatPlaidCat 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

NameStmtsMissBranchBrPartCoverMissing
check_fips_changes.py42421200%8-67
check_kernel_commits.py1791797600%3-371
ciq-cherry-pick.py19410054349%48-50, 55-90, 130, 173, 179-180, 201-202, 224-225, 240-242, 262-271, 294-331, 335-434
ciq-tag.py1461461600%3-378
ciq_tag.py2322325400%1-464
jira_pr_check.py1801808000%3-381
kt/ktlib/ciq_helpers.py325230152626%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.py33206033%16, 20-33, 37-61, 65-66
kt/ktlib/config.py590160100%
kt/ktlib/jira.py14811932016%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.py1475028262%24, 100, 141-143, 148-150, 153-159, 172-183, 194-204, 221-224, 228-263
kt/ktlib/kernels.py961320186%77-85, 139, 155-162
kt/ktlib/local.py510080%12
kt/ktlib/repo.py29152045%30-31, 34-35, 43-55
kt/ktlib/ssh.py1252050%9-12, 16
kt/ktlib/util.py17000100%
kt/ktlib/virt.py803910046%26, 34-37, 51-78, 82-88, 92-93, 97, 101, 105, 109, 119-127, 133-138, 142-147
kt/ktlib/vm.py30215252447%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.py22000%7-27
rolling-release-update.py26426410600%1-412
run_interdiff.py1651655600%3-244
update_lt_spec.py2192194600%9-411
TOTAL287621738201622%

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>
@PlaidCatPlaidCat self-assigned this Aug 14, 2026
CopilotAI lite review requested due to automatic review settings August 14, 2026 19:56

CopilotAI 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 freeto 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

@PlaidCat