cucumber / cucumber/godog

Subtest support to organize test cases

Open
#765 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.7k
Forks
280
Avg merge
2d 20h
Merged PRs (30d)
2

Description

### 🤔 What's the problem you're trying to solve?

The current test runner effectively flattens Gherkin's native nested test definitions. This makes it hard to reason about the rules and test scenarios when a test is failing. Such as if a given change has had a wide impact, or a narrow one. What areas of the codebase might be affected? What rule did I just violate? It makes it hard to reason about which tests a given scenario corresponds to.

### ✨ What's your proposed solution?

Instead, I would like to see a natural nesting that follows the underlying structure of how the tests are described.

```
-- PASS: TestMyFeatures / Feature: Pool Capacity Management / Rule: A pool scales up / Scenario: Pool scales up from below desired capacity.
```

While this would make the test names lengthier, it makes them significantly more easily to idenitfy.

### ⛏ Have you considered any alternatives or workarounds?

This is roughly how [gobdd](https://github.com/go-bdd/gobdd) structures the tests. Which I was previously exploring, but I found this project had better ergonomics in the test's context handling.

I had experimented with walking over the feature files by hand, but there's no way to do this without parsing twice and doing the partitioning, then handing it back to the TestSuite to run. It's a lot of bookkeeping!

### 📚 Any additional context?

Nope, thank you!

Contributor guide

Open the contributing guide

Research direction

Start by tracing the test runner's handling of Gherkin feature, rule, and scenario definitions, and inspect how it currently flattens them. Determine where nested subtests can follow that structure without parsing the feature files twice. Done means failures show the proposed Feature / Rule / Scenario hierarchy while existing test execution remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.