Skip to content

Commit 6dc975d

Browse files
authored
fix: remove cucumber reports suggestion (#2311)
1 parent f1d91d5 commit 6dc975d

11 files changed

+27
-107
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber.
99

1010
## [Unreleased]
11+
### Removed
12+
- Remove Cucumber Reports suggestion ([#2311](https://github.com/cucumber/cucumber-js/pull/2311))
13+
1114
### Fixed
1215
- Fix type import from cucumber-expressions ([#2310](https://github.com/cucumber/cucumber-js/pull/2310))
1316

cucumber.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"html:reports/html-formatter.html"
1212
],
1313
"retry": 2,
14-
"retryTagFilter": "@flaky",
15-
"publishQuiet": true
14+
"retryTagFilter": "@flaky"
1615
}
1716
}

docs/configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ These options can be used in a configuration file (see [above](#files)) or on th
9393
| `order` | `string` | No | `--order` | Run in the order defined, or in a random order | defined |
9494
| `parallel` | `number` | No | `--parallel` | Run tests in parallel with the given number of worker processes - see [Parallel](./parallel.md) | 0 |
9595
| `publish` | `boolean` | No | `--publish` | Publish a report of your test run to <https://reports.cucumber.io/> | false |
96-
| `publishQuiet` | `boolean` | No | `--publish-quiet` | Don't show info about publishing reports | false |
9796
| `require` | `string[]` | Yes | `--require`, `-r` | Paths to where your support code is, for CommonJS - see [below](#finding-your-code) | [] |
9897
| `requireModule` | `string[]` | Yes | `--require-module` | Names of transpilation modules to load, loaded via `require()` - see [Transpiling](./transpiling.md) | [] |
9998
| `retry` | `number` | No | `--retry` | Retry failing tests up to the given number of times - see [Retry](./retry.md) | 0 |

docs/deprecations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ The `Runtime` class is used internally to represent an instance of the serial te
4646

4747
To adapt, pivot to the `runCucumber` function from the [JavaScript API](./javascript_api.md), or raise an issue if you feel your use case isn't catered for.
4848

49+
### publishQuiet
50+
51+
Deprecated in `9.4.0`. Will be removed in `11.0.0` or later.
52+
53+
The `publishQuiet` option (or `--publish-quiet` on the CLI) was used to hide the banner suggesting to use Cucumber Reports. The banner has since been removed, so the option now does nothing.
54+
55+
To adapt, remove the option from your configuration files and CLI commands (especially the latter, since the CLI will fail on unrecognised options).
56+
4957
## Previous deprecations
5058

5159
For deprecations that have been completed (i.e. the functionality removed), see [UPGRADING.md](../UPGRADING.md).

features/publish.feature

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,6 @@ Feature: Publish reports
8585
└──────────────────────────────────────────────────────────────────────────┘
8686
"""
8787

88-
@spawn
89-
Scenario: when results are not published, a banner explains how to publish
90-
When I run cucumber-js
91-
Then the error output contains the text:
92-
"""
93-
┌──────────────────────────────────────────────────────────────────────────────┐
94-
│ Share your Cucumber Report with your team at https://reports.cucumber.io │
95-
│ │
96-
│ Command line option: --publish │
97-
│ Environment variable: CUCUMBER_PUBLISH_ENABLED=true │
98-
│ │
99-
│ More information at https://cucumber.io/docs/cucumber/environment-variables/ │
100-
│ │
101-
│ To disable this message, add this to your ./cucumber.js: │
102-
│ module.exports = { default: '--publish-quiet' } │
103-
└──────────────────────────────────────────────────────────────────────────────┘
104-
"""
105-
10688
@spawn
10789
Scenario: when results are not published due to an error raised by the server, the banner is displayed
10890
When I run cucumber-js with env `CUCUMBER_PUBLISH_TOKEN=keyboardcat`
@@ -115,30 +97,3 @@ Feature: Publish reports
11597
11698
Unexpected http status 401 from GET http://localhost:9987
11799
"""
118-
119-
@spawn
120-
Scenario: the publication banner is not shown when publication is done
121-
When I run cucumber-js with arguments `<args>` and env `<env>`
122-
Then the error output does not contain the text:
123-
"""
124-
Share your Cucumber Report with your team at https://reports.cucumber.io
125-
"""
126-
127-
Examples:
128-
| args | env |
129-
| --publish | |
130-
| | CUCUMBER_PUBLISH_ENABLED=true |
131-
| | CUCUMBER_PUBLISH_TOKEN=f318d9ec-5a3d-4727-adec-bd7b69e2edd3 |
132-
133-
@spawn
134-
Scenario: the publication banner is not shown when publication is disabled
135-
When I run cucumber-js with arguments `<args>` and env `<env>`
136-
Then the error output does not contain the text:
137-
"""
138-
Share your Cucumber Report with your team at https://reports.cucumber.io
139-
"""
140-
141-
Examples:
142-
| args | env |
143-
| --publish-quiet | |
144-
| | CUCUMBER_PUBLISH_QUIET=true |

src/api/load_configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function loadConfiguration(
4343
options.provided
4444
)
4545
logger.debug('Resolved configuration:', original)
46-
validateConfiguration(original)
46+
validateConfiguration(original, logger)
4747
const runnable = await convertConfiguration(original, env)
4848
return {
4949
useConfiguration: original,

src/cli/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { ArgvParser, isTruthyString } from '../configuration'
1+
import { ArgvParser } from '../configuration'
22
import { IFormatterStream } from '../formatter'
33
import { loadConfiguration, runCucumber } from '../api'
44
import { getKeywords, getLanguages } from './i18n'
55
import { validateInstall } from './install_validator'
66
import debug from 'debug'
77

88
export interface ICliRunResult {
9-
shouldAdvertisePublish: boolean
109
shouldExitImmediately: boolean
1110
success: boolean
1211
}
@@ -49,15 +48,13 @@ export default class Cli {
4948
if (options.i18nLanguages) {
5049
this.stdout.write(getLanguages())
5150
return {
52-
shouldAdvertisePublish: false,
5351
shouldExitImmediately: true,
5452
success: true,
5553
}
5654
}
5755
if (options.i18nKeywords) {
5856
this.stdout.write(getKeywords(options.i18nKeywords))
5957
return {
60-
shouldAdvertisePublish: false,
6158
shouldExitImmediately: true,
6259
success: true,
6360
}
@@ -81,10 +78,6 @@ export default class Cli {
8178
)
8279
const { success } = await runCucumber(runConfiguration, environment)
8380
return {
84-
shouldAdvertisePublish:
85-
!runConfiguration.formats.publish &&
86-
!configuration.publishQuiet &&
87-
!isTruthyString(this.env.CUCUMBER_PUBLISH_QUIET),
8881
shouldExitImmediately: configuration.forceExit,
8982
success,
9083
}

src/cli/publish_banner.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/cli/run.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
* but other code abstracts those to remain composable and testable. */
44
import Cli, { ICliRunResult } from './'
55
import VError from 'verror'
6-
import publishBanner from './publish_banner'
76
import { validateNodeEngineVersion } from './validate_node_engine_version'
87

98
function logErrorMessageAndExit(message: string): void {
109
console.error(message)
1110
process.exit(1)
1211
}
1312

14-
function displayPublishAdvertisementBanner(): void {
15-
console.error(publishBanner)
16-
}
17-
1813
export default async function run(): Promise<void> {
1914
validateNodeEngineVersion(
2015
process.version,
@@ -40,10 +35,6 @@ export default async function run(): Promise<void> {
4035
logErrorMessageAndExit(VError.fullStack(error))
4136
}
4237

43-
if (result.shouldAdvertisePublish) {
44-
displayPublishAdvertisementBanner()
45-
}
46-
4738
const exitCode = result.success ? 0 : 1
4839
if (result.shouldExitImmediately) {
4940
process.exit(exitCode)

src/configuration/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export interface IConfiguration {
1515
paths: string[]
1616
parallel: number
1717
publish: boolean
18+
/**
19+
* @deprecated no longer needed; see <https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md>
20+
*/
1821
publishQuiet: boolean
1922
require: string[]
2023
requireModule: string[]

src/configuration/validate_configuration.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import { IConfiguration } from './types'
2+
import { ILogger } from '../logger'
23

3-
export function validateConfiguration(configuration: IConfiguration): void {
4+
export function validateConfiguration(
5+
configuration: IConfiguration,
6+
logger: ILogger
7+
): void {
8+
if (configuration.publishQuiet) {
9+
logger.warn(
10+
'`publishQuiet` option is no longer needed, you can remove it from your configuration; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'
11+
)
12+
}
413
if (configuration.retryTagFilter && !configuration.retry) {
514
throw new Error(
615
'a positive `retry` count must be specified when setting `retryTagFilter`'

0 commit comments

Comments
 (0)