spockframework / spockframework/spock

IRunListener#featureSkipped not called for @Requires({false})

Open
#1,168 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Issue description

The method void featureSkipped(FeatureInfo feature) does not get called if a feature is skipped due to the @Requires annotation.
This is despite the fact that the feature itself, as obtained via specInfo.features in the same listener has its skipped property set to true, together with a skipReason of Ignored via @Requires.

How to reproduce

  1. Create an instance of an AbstractRunListener
  2. Override featureSkipped
  3. Attach it to a spec that has a feature with @Requires({ false })
  4. Debug the spec, observe that the featureSkipped method will not get called.

Link to a gist or similar (optional)

Additional Environment information

Using Spock version 2.0M2

Java/JDK

1.8

Groovy version

3.0.3

Build tool version

Gradle

6.4.1

Operating System

MacOS

IDE

IntelliJ

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 with AbstractRunListener.featureSkipped and the feature execution path for features marked skipped by @Requires({ false }). Reproduce with a spec containing that annotation and verify that the listener callback is invoked for the skipped feature, matching its skipped property and skipReason of "Ignored via @Requires".

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.