spockframework / spockframework/spock
Unroll - get original method name in JUnit listener
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
I am working on creating test impact analysis tool for Spock test cases, for which I need access to method name to maintain mapping from test methods to source methods or classes.
This is helpful to us for reducing the build time while running integration test cases.
We are using JUnit5 Listener to get the name of the test name and using Instrumentation to maintain the list of classes and methods touched/impacted by a particular test.
Once that mapping is maintained, once a developer makes changes to code, then we will make a reverse lookup from source method/source class to list of impacted tests that need to be run and only those.
But in case of @Unroll annotation it doesn't work for us, because the name is replaced with the values from provider.
@Unroll("Updated method")
def "This is original method name"() {
...
}
We are using Gradle for executing the build process. So to filter and run only a particular tests we need to pass original method names in gradle test task.
Question: Is there a way to get access to original method name from Junit 5 Listener?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JUnit 5 listener entry point and the handling of Spock's @Unroll names, then check how the Gradle test task receives method filters. The issue mentions Instrumentation but no repository files or tests; done would require a clearly supported way to access the original method name or a documented conclusion that it is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100