cucumber / cucumber/messages

Expose the max number of retries to formatters

Open
#71 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
41
Forks
24
Avg merge
2d 4h
Merged PRs (30d)
6

Description

Hey @davidjgoss and @charlierudolph!

Would it be possible to make the information about the max number of retries specified via [`--retry`](https://github.com/cucumber/cucumber-js/blob/master/features/retry.feature) parameter available to Cucumber formatters?

At the moment Cucumber messages provide information about the **current** `attempt` number, for example:
```json
{"testCaseStarted":{"attempt":1,"timestamp":{"seconds":"1609892232","nanos":945000000},"testCaseId":"d6c24ef0-66c4-42f7-a62e-2d6b976a40ff","id":"9b5d1c83-09a3-466d-8c14-e3c2b14918ea"}}
```

However, they don't tell how many attempts there are **left**, which makes reporting a bit inconvenient.

Perhaps this information could be added to [`IFormatterOptions`](https://github.com/cucumber/cucumber-js/blob/3d8d2327c794c01fd9c9fca58f4f924b9f9bde7a/src/formatter/index.ts#L20-L31) either to the main `options` object itself or under `parsedArgvOptions`. I think the behaviour could be similar to how the [`RerunFormatter`](https://github.com/cucumber/cucumber-js/blob/3d8d2327c794c01fd9c9fca58f4f924b9f9bde7a/src/formatter/rerun_formatter.ts#L29) works.

Is this a feature you'd be willing to add / review a PR for?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.