apache / apache/grails-intellij-plugin

#Groovy: code coverage ignores code in closure

Open
#130 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Using Groovy in Grails framework.

When I have a code inside a closure, that code is not covered in results of the code coverage. The number of these lines of code is missing in the final percentage and also, these lines are marked red in the column with line numbers, as it were not tested.
```
1. myClosure(myParam) {
2. callMyFunction()
3. }
```
Line 2 will not be counted.

---

*Imported from [IDEA-109085](https://youtrack.jetbrains.com/issue/IDEA-109085) · Type: Bug · Votes: 1*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the closure example from the issue in the Grails IntelliJ plugin's coverage support and trace how Groovy closure lines are collected. Done means the callMyFunction() line is included in the total coverage percentage and is no longer marked as uncovered when the closure executes.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.