test: fix processes-services coverage gate failure on feature/ai-contribution - EXO-88467 - #487
Merged
Jihed525 merged 1 commit intoJul 21, 2026
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI (
addon-processes-ai-contribution-fb-ci) failsprocesses-servicesat the JaCoCo-Pcoveragegate:developalready sits right at the edge (58.1% instruction coverage).ProcessesMcpTool, added by #486, landed with only 2 tests (ProcessesMcpToolTest), both narrowly guardinglistProcesses/getPendingApprovalsagainst a null-unbox NPE — the other methods (getMyRequests,getRequestDetails,submitWorkRequest,cancelWorkRequest, and the task-mapping half ofgetPendingApprovals) 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 blankgetRequestDetails: invalid id, not-found, happy pathsubmitWorkRequest: invalid id/title, process not found, disabled process, happy path (asserts the createdWork's project id/description)cancelWorkRequest: invalid id, not-found, idempotent no-op when already canceled, happy path (asserts status/completed + thatupdateWorkisn't called on the no-op branch)getPendingApprovals: empty when no managed process (andtaskServiceisn't called), task-to-PendingApprovalModelmapping (title/id/project) when a managed process has pending tasksResult
ProcessesMcpTool: 20.7% → 92.9% instruction coverageprocesses-servicesbundle: 55% → 60.4%Test plan
mvn -pl processes-services test -Dtest=ProcessesMcpToolTest— 18/18 passmvn -pl processes-services -Pcoverage clean install—BUILD SUCCESS, no rule violationmvn -Pcoverage clean install(full reactor) —BUILD SUCCESS