Skip to content

test: fix processes-services coverage gate failure on feature/ai-contribution - EXO-88467 - #487

Merged
Jihed525 merged 1 commit into
feature/ai-contributionfrom
fix/EXO-88467-mcp-tool-coverage
Jul 21, 2026
Merged

test: fix processes-services coverage gate failure on feature/ai-contribution - EXO-88467#487
Jihed525 merged 1 commit into
feature/ai-contributionfrom
fix/EXO-88467-mcp-tool-coverage

Conversation

@Jihed525

Copy link
Copy Markdown
Member

Summary

CI (addon-processes-ai-contribution-fb-ci) fails processes-services at the JaCoCo -Pcoverage gate:

[WARNING] Rule violated for bundle processes-services: instructions covered ratio is 0.55, but expected minimum is 0.58

develop already sits right at the edge (58.1% instruction coverage). ProcessesMcpTool, added by #486, landed with only 2 tests (ProcessesMcpToolTest), both narrowly guarding listProcesses/getPendingApprovals against a null-unbox NPE — the other methods (getMyRequests, getRequestDetails, submitWorkRequest, cancelWorkRequest, and the task-mapping half of getPendingApprovals) were untested, leaving the class at 20.7% coverage (111/536 instructions). That's enough to drag the whole bundle to 55%, under the gate.

Fix

Added tests for the remaining methods in ProcessesMcpToolTest:

  • getMyRequests: status passed through / left unset when blank
  • getRequestDetails: invalid id, not-found, happy path
  • submitWorkRequest: invalid id/title, process not found, disabled process, happy path (asserts the created Work's project id/description)
  • cancelWorkRequest: invalid id, not-found, idempotent no-op when already canceled, happy path (asserts status/completed + that updateWork isn't called on the no-op branch)
  • getPendingApprovals: empty when no managed process (and taskService isn't called), task-to-PendingApprovalModel mapping (title/id/project) when a managed process has pending tasks

Result

  • ProcessesMcpTool: 20.7% → 92.9% instruction coverage
  • processes-services bundle: 55% → 60.4%

Test plan

  • mvn -pl processes-services test -Dtest=ProcessesMcpToolTest — 18/18 pass
  • mvn -pl processes-services -Pcoverage clean installBUILD SUCCESS, no rule violation
  • mvn -Pcoverage clean install (full reactor) — BUILD SUCCESS

The CI coverage gate (-Pcoverage, min 0.58 instruction ratio) failed on
feature/ai-contribution: ProcessesMcpTool (added by #486) was at 20.7%
coverage since ProcessesMcpToolTest only guarded listProcesses/
getPendingApprovals against a null-unbox NPE, leaving getMyRequests,
getRequestDetails, submitWorkRequest, cancelWorkRequest and the
task-mapping path of getPendingApprovals untested. That dragged the
processes-services bundle to 55%, under develop's already-thin 58.1%
margin.

Added tests for the remaining methods (validation errors, not-found,
happy path, the cancel-is-idempotent branch, and the pending-approvals
task-to-model mapping), bringing ProcessesMcpTool to 92.9% and the
bundle to 60.4%. Verified with mvn -Pcoverage clean install on the
processes-services module and the full reactor.
@Jihed525
Jihed525 merged commit 6cac20c into feature/ai-contribution Jul 21, 2026
3 checks passed
@Jihed525
Jihed525 deleted the fix/EXO-88467-mcp-tool-coverage branch July 21, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant