Skip to content

Commit d082235

Browse files
committed
Revert back to using cli option --publish-quiet instead of --no-publish-ad
This reverts commit d0f9d2f.
1 parent 7885d48 commit d082235

21 files changed

+40
-40
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
1515
### Added
1616

1717
* `--publish` automatically publishes reports to [reports.cucumber.io](https://reports.cucumber.io)
18-
* `--no-publish-ad` does not print information banner about [reports.cucumber.io](https://reports.cucumber.io)
19-
* `-q, --quiet` will also imply `--no-publish-ad` in addition to `--no-snippets --no-source --no-duration`
18+
* `--publish-quiet` does not print information banner about [reports.cucumber.io](https://reports.cucumber.io)
19+
* `-q, --quiet` will also imply `--publish-quiet` in addition to `--no-snippets --no-source --no-duration`
2020

2121
### Changed
2222

features/docs/cli/dry_run.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Dry Run
1313
Given this step fails
1414
"""
1515
And the standard step definitions
16-
When I run `cucumber --dry-run --no-publish-ad`
16+
When I run `cucumber --dry-run --publish-quiet`
1717
Then it should pass with exactly:
1818
"""
1919
Feature: test
@@ -34,7 +34,7 @@ Feature: Dry Run
3434
Given this step fails
3535
"""
3636
And the standard step definitions
37-
When I run `cucumber --dry-run --strict --no-publish-ad`
37+
When I run `cucumber --dry-run --strict --publish-quiet`
3838
Then it should pass with exactly:
3939
"""
4040
Feature: test

features/docs/cli/publish_banner.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ Feature: Publish banner
2121
│ More information at https://reports.cucumber.io/docs/cucumber-ruby │
2222
│ │
2323
│ To disable this message, specify CUCUMBER_PUBLISH_QUIET=true or use the │
24-
│ --no-publish-ad option. You can also add this to your cucumber.yml: │
25-
│ default: --no-publish-ad
24+
│ --publish-quiet option. You can also add this to your cucumber.yml: │
25+
│ default: --publish-quiet
2626
└──────────────────────────────────────────────────────────────────────────┘
2727
"""
2828

29-
Scenario: Banner is not displayed when using --no-publish-ad
29+
Scenario: Banner is not displayed when using --publish-quiet
3030
Given a file named "features/hello.feature" with:
3131
"""
3232
Feature: Hello
3333
"""
34-
When I run `cucumber --no-publish-ad`
34+
When I run `cucumber --publish-quiet`
3535
Then the output should not contain:
3636
"""
3737
Share your Cucumber Report with your team at https://reports.cucumber.io

features/docs/cli/specifying_multiple_formatters.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Feature: Running multiple formatters
1818
"""
1919

2020
Scenario: Multiple formatters and outputs
21-
When I run `cucumber --no-color --format progress --out progress.txt --format pretty --out pretty.txt --no-source --dry-run --no-snippets features/test.feature --no-publish-ad`
21+
When I run `cucumber --no-color --format progress --out progress.txt --format pretty --out pretty.txt --no-source --dry-run --no-snippets features/test.feature --publish-quiet`
2222
Then the stderr should not contain anything
2323
Then the file "progress.txt" should contain:
2424
"""

features/docs/defining_steps/ambiguous_steps.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Feature: Ambiguous Steps
7272
'bar'
7373
end
7474
"""
75-
When I run `cucumber -g --no-publish-ad`
75+
When I run `cucumber -g --publish-quiet`
7676
Then it should pass with exactly:
7777
"""
7878
Feature:

features/docs/defining_steps/table_diffing.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Feature: Table diffing
2222
}))
2323
end
2424
"""
25-
When I run `cucumber features/tables.feature --no-publish-ad`
25+
When I run `cucumber features/tables.feature --publish-quiet`
2626
Then it should fail with exactly:
2727
"""
2828
Feature: Tables

features/docs/exception_in_before_hook.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Feature: Exception in Before Block
5151
Scenario: Run a good step
5252
Given this step passes
5353
"""
54-
When I run `cucumber features --no-publish-ad`
54+
When I run `cucumber features --publish-quiet`
5555
Then it should fail with exactly:
5656
"""
5757
Feature: Sample

features/docs/extending_cucumber/custom_formatter.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Feature: Custom Formatter
3030
end
3131
end
3232
"""
33-
When I run `cucumber features/f.feature --format MyCustom::Formatter --no-publish-ad`
33+
When I run `cucumber features/f.feature --format MyCustom::Formatter --publish-quiet`
3434
Then it should pass with exactly:
3535
"""
3636
JUST PRINT ME
@@ -51,7 +51,7 @@ Feature: Custom Formatter
5151
end
5252
end
5353
"""
54-
When I run `cucumber features/f.feature --format MyCustom::Formatter,foo=bar,one=two --no-publish-ad`
54+
When I run `cucumber features/f.feature --format MyCustom::Formatter,foo=bar,one=two --publish-quiet`
5555
Then it should pass with exactly:
5656
"""
5757
{"foo"=>"bar", "one"=>"two"}

features/docs/formatters/junit_formatter.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ You *must* specify --out DIR for the junit formatter
337337
"""
338338

339339
Scenario: strict mode with --expand option, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
340-
When I run `cucumber --strict --expand --format junit --out tmp/ features/scenario_outline.feature --no-publish-ad`
340+
When I run `cucumber --strict --expand --format junit --out tmp/ features/scenario_outline.feature --publish-quiet`
341341
Then it should fail with exactly:
342342
"""
343343

features/docs/formatters/rerun_formatter.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Feature: Rerun formatter
3434
3535
"""
3636

37-
When I run `cucumber --no-publish-ad -f rerun`
37+
When I run `cucumber --publish-quiet -f rerun`
3838
Then it should pass with exactly:
3939
"""
4040
"""
@@ -65,7 +65,7 @@ Feature: Rerun formatter
6565
Given this step passes
6666
"""
6767

68-
When I run `cucumber --no-publish-ad -f rerun --dry-run`
68+
When I run `cucumber --publish-quiet -f rerun --dry-run`
6969
Then it should pass with exactly:
7070
"""
7171
"""
@@ -96,7 +96,7 @@ Feature: Rerun formatter
9696
Given this step passes
9797
"""
9898

99-
When I run `cucumber --no-publish-ad -f rerun --strict`
99+
When I run `cucumber --publish-quiet -f rerun --strict`
100100
Then it should fail with exactly:
101101
"""
102102
features/mixed.feature:3:6:9

features/docs/formatters/summary_formatter.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Spec formatter
1616
Scenario: Failing
1717
Given this step fails
1818
"""
19-
When I run `cucumber --format summary --no-publish-ad`
19+
When I run `cucumber --format summary --publish-quiet`
2020
Then it should fail with exactly:
2121
"""
2222
Test

features/docs/formatters/usage_formatter.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Feature: Usage formatter
3131
"""
3232

3333
Scenario: Run with --format usage
34-
When I run `cucumber -f usage --dry-run --no-publish-ad`
34+
When I run `cucumber -f usage --dry-run --publish-quiet`
3535
Then it should pass with exactly:
3636
"""
3737
-----------
@@ -56,7 +56,7 @@ Feature: Usage formatter
5656
"""
5757

5858
Scenario: Run with --expand --format usage
59-
When I run `cucumber -x -f usage --dry-run --no-publish-ad`
59+
When I run `cucumber -x -f usage --dry-run --publish-quiet`
6060
Then it should pass with exactly:
6161
"""
6262
-----------
@@ -81,7 +81,7 @@ Feature: Usage formatter
8181
"""
8282

8383
Scenario: Run with --format stepdefs
84-
When I run `cucumber -f stepdefs --dry-run --no-publish-ad`
84+
When I run `cucumber -f stepdefs --dry-run --publish-quiet`
8585
Then it should pass with exactly:
8686
"""
8787
-----------

features/docs/gherkin/using_star_notation.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Feature: Using star notation instead of Given/When/Then
1515
Scenario: S
1616
* I have some cukes
1717
"""
18-
When I run `cucumber features/f.feature --no-publish-ad`
18+
When I run `cucumber features/f.feature --publish-quiet`
1919
Then the stderr should not contain anything
2020
And it should pass with:
2121
"""

features/docs/post_configuration_hook.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: Post Configuration Hook [#423]
1717
Scenario:
1818
Given a step
1919
"""
20-
When I run `cucumber features --no-publish-ad`
20+
When I run `cucumber features --publish-quiet`
2121
Then the stderr should not contain anything
2222
And the output should contain NDJSON with key "uri" and value "features/simple_scenario.feature"
2323

@@ -28,7 +28,7 @@ Feature: Post Configuration Hook [#423]
2828
config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}"
2929
end
3030
"""
31-
When I run `cucumber features --no-publish-ad`
31+
When I run `cucumber features --publish-quiet`
3232
Then the stderr should not contain anything
3333
And the output should contain:
3434
"""

features/docs/writing_support_code/tagged_hooks.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Feature: Tagged hooks
3232
"""
3333

3434
Scenario: omit tagged hook
35-
When I run `cucumber features/f.feature:2 --no-publish-ad`
35+
When I run `cucumber features/f.feature:2 --publish-quiet`
3636
Then it should fail with exactly:
3737
"""
3838
Feature: With and without hooks
@@ -52,7 +52,7 @@ Feature: Tagged hooks
5252
"""
5353

5454
Scenario: omit tagged hook
55-
When I run `cucumber features/f.feature:6 --no-publish-ad`
55+
When I run `cucumber features/f.feature:6 --publish-quiet`
5656
Then it should pass with exactly:
5757
"""
5858
Feature: With and without hooks
@@ -67,7 +67,7 @@ Feature: Tagged hooks
6767
6868
"""
6969
Scenario: Omit example hook
70-
When I run `cucumber features/f.feature:14 --no-publish-ad`
70+
When I run `cucumber features/f.feature:14 --publish-quiet`
7171
Then it should fail with exactly:
7272
"""
7373
Feature: With and without hooks

lib/cucumber/cli/options.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def parse!(args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
9595
@args.options do |opts| # rubocop:disable Metrics/BlockLength
9696
opts.banner = banner
9797
opts.on('--publish', 'Publish a report to https://reports.cucumber.io') { @options[:formats] << publisher }
98-
opts.on('--no-publish-ad', 'Don\'t print advertisement banner about publishing reports') { set_option :publish_ad, false }
98+
opts.on('--publish-quiet', 'Don\'t print information banner about publishing reports') { set_option :publish_quiet }
9999
opts.on('-r LIBRARY|DIR', '--require LIBRARY|DIR', *require_files_msg) { |lib| require_files(lib) }
100100

101101
opts.on('-j DIR', '--jars DIR', 'Load all the jars under DIR') { |jars| load_jars(jars) } if Cucumber::JRUBY
@@ -120,7 +120,7 @@ def parse!(args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
120120
opts.on('-s', '--no-source', "Don't print the file and line of the step definition with the steps.") { set_option :source, false }
121121
opts.on('-i', '--no-snippets', "Don't print snippets for pending steps.") { set_option :snippets, false }
122122
opts.on('-I', '--snippet-type TYPE', *snippet_type_msg) { |v| set_option :snippet_type, v.to_sym }
123-
opts.on('-q', '--quiet', 'Alias for --no-snippets --no-source --no-duration --no-publish-ad.') { shut_up }
123+
opts.on('-q', '--quiet', 'Alias for --no-snippets --no-source --no-duration --publish-quiet.') { shut_up }
124124
opts.on('--no-duration', "Don't print the duration at the end of the summary") { set_option :duration, false }
125125
opts.on('-b', '--backtrace', 'Show full backtrace for all errors.') { Cucumber.use_full_backtrace = true }
126126
opts.on('-S', '--[no-]strict', *strict_msg) { |setting| set_strict(setting) }
@@ -424,7 +424,7 @@ def exit_ok(text)
424424
end
425425

426426
def shut_up
427-
@options[:publish_ad] = false
427+
@options[:publish_quiet] = true
428428
@options[:snippets] = false
429429
@options[:source] = false
430430
@options[:duration] = false

lib/cucumber/configuration.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def dry_run?
6262
@options[:dry_run]
6363
end
6464

65-
def publish_ad?
66-
@options[:publish_ad]
65+
def publish_quiet?
66+
@options[:publish_quiet]
6767
end
6868

6969
def fail_fast?
@@ -260,7 +260,7 @@ def default_options
260260
strict: Cucumber::Core::Test::Result::StrictConfiguration.new,
261261
require: [],
262262
dry_run: false,
263-
publish_ad: true,
263+
publish_quiet: false,
264264
fail_fast: false,
265265
formats: [],
266266
excludes: [],

lib/cucumber/formatter/publish_banner_printer.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def display_publish_ad(io)
4646
' or use the '
4747
],
4848
[
49-
pre('--no-publish-ad'),
49+
pre('--publish-quiet'),
5050
' option. You can also add this to your ',
5151
pre('cucumber.yml:')
5252
],
53-
[pre('default: --no-publish-ad')]
53+
[pre('default: --publish-quiet')]
5454
],
5555
io
5656
)

lib/cucumber/runtime.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def report
172172
return @report if @report
173173
reports = [summary_report] + formatters
174174
reports << fail_fast_report if @configuration.fail_fast?
175-
reports << publish_banner_printer if @configuration.publish_ad?
175+
reports << publish_banner_printer unless @configuration.publish_quiet?
176176
@report ||= Formatter::Fanout.new(reports)
177177
end
178178

spec/cucumber/cli/options_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def with_env(name, value)
335335
given_cucumber_yml_defined_as('foo' => '-q')
336336
options.parse!(%w[-p foo])
337337

338-
expect(options[:publish_ad]).to be false
338+
expect(options[:publish_quiet]).to be true
339339
expect(options[:snippets]).to be false
340340
expect(options[:source]).to be false
341341
expect(options[:duration]).to be false

spec/cucumber/formatter/publish_banner_printer_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ module Formatter
3434
│ More information at https://reports.cucumber.io/docs/cucumber-ruby │
3535
│ │
3636
│ To disable this message, specify CUCUMBER_PUBLISH_QUIET=true or use the │
37-
│ --no-publish-ad option. You can also add this to your cucumber.yml: │
38-
│ default: --no-publish-ad
37+
│ --publish-quiet option. You can also add this to your cucumber.yml: │
38+
│ default: --publish-quiet
3939
└──────────────────────────────────────────────────────────────────────────┘
4040
BANNER
4141
end

0 commit comments

Comments
 (0)