spockframework / spockframework/spock

Provide access to ExtensionContext/ExtensionStore in IMethodInvocation and Extensions.

Open
#1,273 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Jupiter gives its extensions access to ExtensionContext to store state(Keeping State in Extensions). Spock doesn't have this concept at the moment, instead extensions register interceptors that can have local state. This works fine most of the time, but with parallel execution new problems arise (#1272). Having a way to store and transport custom extension data similar to what Juptier provides could be an elegant solution.
Furthermore, this would remove one of the major issues with supporting Jupiter extensions in a yet to come spock-jupiter module.

Classes of interest:

  • org.junit.jupiter.api.extension.ExtensionContext
  • org.junit.jupiter.engine.execution.ExtensionValuesStore

Please comment @spockframework/supporter

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the IMethodInvocation and Extensions entry points, then compare the named Jupiter ExtensionContext and ExtensionValuesStore classes. Review the parallel-execution problem in #1272 and determine how custom extension data should be accessed and transported. Done means the design supports the stated extension use case and future spock-jupiter integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.