Skip to content

Commit a558859

Browse files
committed
Make --quiet also do --publish-quiet
1 parent 8288d8e commit a558859

17 files changed

+29
-26
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
1616

1717
* `--publish` automatically publishes reports to [reports.cucumber.io](https://reports.cucumber.io)
1818
* `--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`
1920

2021
### Changed
2122

features/docs/cli/randomize.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Feature: Randomize
108108

109109
@global_state
110110
Scenario: Run scenarios randomized with some skipped
111-
When I run `cucumber --tags "not @skipme" --order random:41544 -q --publish-quiet`
111+
When I run `cucumber --tags "not @skipme" --order random:41544 -q`
112112
Then it should fail with exactly:
113113
"""
114114
Feature: Bad practice, part 1

features/docs/cli/run_specific_scenarios.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Feature: Run specific scenarios
2323
Scenario: Hit
2424
Given this step passes
2525
"""
26-
When I run `cucumber features/test.feature:6 --format pretty --quiet --publish-quiet`
26+
When I run `cucumber features/test.feature:6 --format pretty --quiet `
2727
Then it should pass with exactly:
2828
"""
2929
Feature:

features/docs/defining_steps/nested_steps.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Feature: Nested Steps
156156
step 'a step that calls an undefined step'
157157
end
158158
"""
159-
When I run `cucumber -q features/call_undefined_step_from_step_def.feature --publish-quiet`
159+
When I run `cucumber -q features/call_undefined_step_from_step_def.feature`
160160
Then it should fail with exactly:
161161
"""
162162
Feature: Calling undefined step

features/docs/defining_steps/printing_messages.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Feature: Pretty formatter - Printing messages
7676
"""
7777

7878
Scenario: Delayed messages feature
79-
When I run `cucumber --quiet --format pretty features/f.feature --publish-quiet`
79+
When I run `cucumber --quiet --format pretty features/f.feature`
8080
Then the stderr should not contain anything
8181
And the output should contain:
8282
"""

features/docs/defining_steps/skip_scenario.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Feature: Skip Scenario
1515
skip_this_scenario
1616
end
1717
"""
18-
When I run `cucumber -q --publish-quiet`
18+
When I run `cucumber -q`
1919
Then it should pass with exactly:
2020
"""
2121
Feature: test

features/docs/exception_in_around_hook.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Feature: Exceptions in Around Hooks
2727
Scenario:
2828
Given this step passes
2929
"""
30-
When I run `cucumber -q --publish-quiet`
30+
When I run `cucumber -q`
3131
Then it should fail with exactly:
3232
"""
3333
Feature:
@@ -59,7 +59,7 @@ Feature: Exceptions in Around Hooks
5959
Scenario:
6060
Given this step passes
6161
"""
62-
When I run `cucumber -q --publish-quiet --publish-quiet`
62+
When I run `cucumber -q`
6363
Then it should fail with exactly:
6464
"""
6565
Feature:

features/docs/formatters/pretty_formatter.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Feature: Pretty output formatter
5151
raise "error"
5252
end
5353
"""
54-
When I run `cucumber -q -f pretty features/test.feature --publish-quiet`
54+
When I run `cucumber -q -f pretty features/test.feature`
5555
Then the stderr should not contain anything
5656
Then it should fail with:
5757
"""

features/docs/gherkin/background.feature

+11-11
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Feature: Background
209209
"""
210210

211211
Scenario: run a specific scenario with a background
212-
When I run `cucumber -q features/passing_background.feature:9 --publish-quiet`
212+
When I run `cucumber -q features/passing_background.feature:9`
213213
Then it should pass with exactly:
214214
"""
215215
Feature: Passing background sample
@@ -226,7 +226,7 @@ Feature: Background
226226
"""
227227

228228
Scenario: run a feature with a background that passes
229-
When I run `cucumber -q features/passing_background.feature --publish-quiet`
229+
When I run `cucumber -q features/passing_background.feature`
230230
Then it should pass with exactly:
231231
"""
232232
Feature: Passing background sample
@@ -246,7 +246,7 @@ Feature: Background
246246
"""
247247

248248
Scenario: run a feature with scenario outlines that has a background that passes
249-
When I run `cucumber -q features/scenario_outline_passing_background.feature --publish-quiet`
249+
When I run `cucumber -q features/scenario_outline_passing_background.feature`
250250
Then it should pass with exactly:
251251
"""
252252
Feature: Passing background with scenario outlines sample
@@ -274,7 +274,7 @@ Feature: Background
274274
"""
275275

276276
Scenario: run a feature with scenario outlines that has a background that passes
277-
When I run `cucumber -q features/background_tagged_before_on_outline.feature --publish-quiet`
277+
When I run `cucumber -q features/background_tagged_before_on_outline.feature`
278278
Then it should pass with exactly:
279279
"""
280280
@background_tagged_before_on_outline
@@ -296,7 +296,7 @@ Feature: Background
296296
"""
297297

298298
Scenario: run a feature with a background that fails
299-
When I run `cucumber -q features/failing_background.feature --publish-quiet`
299+
When I run `cucumber -q features/failing_background.feature`
300300
Then it should fail with exactly:
301301
"""
302302
Feature: Failing background sample
@@ -324,7 +324,7 @@ Feature: Background
324324
"""
325325

326326
Scenario: run a feature with scenario outlines that has a background that fails
327-
When I run `cucumber -q features/scenario_outline_failing_background.feature --publish-quiet`
327+
When I run `cucumber -q features/scenario_outline_failing_background.feature`
328328
Then it should fail with exactly:
329329
"""
330330
Feature: Failing background with scenario outlines sample
@@ -359,7 +359,7 @@ Feature: Background
359359
"""
360360

361361
Scenario: run a feature with a background that is pending
362-
When I run `cucumber -q features/pending_background.feature --publish-quiet`
362+
When I run `cucumber -q features/pending_background.feature`
363363
Then it should pass with exactly:
364364
"""
365365
Feature: Pending background sample
@@ -379,7 +379,7 @@ Feature: Background
379379
"""
380380

381381
Scenario: background passes with first scenario but fails with second
382-
When I run `cucumber -q features/failing_background_after_success.feature --publish-quiet`
382+
When I run `cucumber -q features/failing_background_after_success.feature`
383383
Then it should fail with exactly:
384384
"""
385385
Feature: Failing background after previously successful background sample
@@ -408,7 +408,7 @@ Feature: Background
408408

409409
@global_state
410410
Scenario: background passes with first outline scenario but fails with second
411-
When I run `cucumber -q features/failing_background_after_success_outline.feature --publish-quiet`
411+
When I run `cucumber -q features/failing_background_after_success_outline.feature`
412412
Then it should fail with exactly:
413413
"""
414414
Feature: Failing background after previously successful background sample
@@ -444,7 +444,7 @@ Feature: Background
444444

445445
@global_state
446446
Scenario: background passes with first outline scenario but fails with second (--expand)
447-
When I run `cucumber -x -q features/failing_background_after_success_outline.feature --publish-quiet`
447+
When I run `cucumber -x -q features/failing_background_after_success_outline.feature`
448448
Then it should fail with exactly:
449449
"""
450450
Feature: Failing background after previously successful background sample
@@ -500,7 +500,7 @@ Feature: Background
500500
expect(@multiline).to eq string
501501
end
502502
"""
503-
When I run `cucumber -q features/multiline_args_background.feature --publish-quiet`
503+
When I run `cucumber -q features/multiline_args_background.feature`
504504
Then it should pass with exactly:
505505
"""
506506
Feature: Passing background with multiline args

features/docs/gherkin/example.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Feature: Example
2929
"""
3030

3131
Example: I can use the Example keyword
32-
When I run `cucumber -q features/example.feature --publish-quiet`
32+
When I run `cucumber -q features/example.feature`
3333
Then it should pass with exactly:
3434
"""
3535
Feature: A simple example

features/docs/gherkin/expand_option_for_outlines.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Feature: Scenario outlines --expand option
1818
| blue | blue | right |
1919
| red | blue | wrong |
2020
"""
21-
When I run `cucumber -i -q --expand --publish-quiet`
21+
When I run `cucumber -i -q --expand`
2222
Then the stderr should not contain anything
2323
And it should pass with:
2424
"""

features/docs/gherkin/outlines.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Feature: Scenario outlines
127127
"""
128128

129129
Scenario: Run all with progress formatter
130-
When I run `cucumber -q --format progress features/outline_sample.feature --publish-quiet`
130+
When I run `cucumber -q --format progress features/outline_sample.feature`
131131
Then it should fail with exactly:
132132
"""
133133
U-..F-..

features/docs/gherkin/rule.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Feature: Rule
4141

4242
Rule: I use Gherkin 6+
4343
Example: I can use the Rule keyword
44-
When I run `cucumber -q features/rule.feature --publish-quiet`
44+
When I run `cucumber -q features/rule.feature`
4545
Then it should pass with exactly:
4646
"""
4747
Feature: Rule Sample

features/docs/gherkin/using_descriptions.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Feature: Using descriptions to give features context
4949
| state |
5050
| passes |
5151
"""
52-
When I run `cucumber -q --publish-quiet`
52+
When I run `cucumber -q`
5353
Then the stderr should not contain anything
5454
Then it should pass with exactly:
5555
"""

features/docs/work_in_progress.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Feature: Cucumber --work-in-progress switch
3737
"""
3838

3939
Scenario: Pass with Failing Scenarios
40-
When I run `cucumber -q -w -t @failing features/wip.feature --publish-quiet`
40+
When I run `cucumber -q -w -t @failing features/wip.feature`
4141
Then the stderr should not contain anything
4242
Then it should pass with:
4343
"""

lib/cucumber/cli/options.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -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.') { 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) }
@@ -418,6 +418,7 @@ def exit_ok(text)
418418
end
419419

420420
def shut_up
421+
@options[:publish_quiet] = true
421422
@options[:snippets] = false
422423
@options[:source] = false
423424
@options[:duration] = false

spec/cucumber/cli/options_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def after_parsing(args)
324324
given_cucumber_yml_defined_as('foo' => '-q')
325325
options.parse!(%w[-p foo])
326326

327+
expect(options[:publish_quiet]).to be true
327328
expect(options[:snippets]).to be false
328329
expect(options[:source]).to be false
329330
expect(options[:duration]).to be false

0 commit comments

Comments
 (0)