Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecation from flags, update example to use CLI flags #498

Merged
merged 4 commits into from
Aug 31, 2022

Conversation

vearutop
Copy link
Member

@vearutop vearutop commented Aug 30, 2022

🤔 What's changed?

This PR

  • removes deprecation from godog.BindFlags,
  • updates godogs example to use *testing.T and godog CLI flags,
  • adds godogs example scenarios to showcase feature filtering with CLI flags,
  • fixes @TODO: sort by name for list of available formatters,
  • Adds -help and -paths options to godog.BindFlags for better compatibility with go test.

⚡️ What's your motivation?

Recently there was a question about godog flag usage when running with go test.

It turned out the most straightforward way to configure flags would be to use currently deprecated godog.BindFlags.

godog CLI now uses flag instrumentation based on github.com/spf13/pflag, however it is less suitable for go test because it operates with stdlib flag.

image

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@github-actions
Copy link

Go API Changes

# github.com/cucumber/godog
## compatible changes
Feature: added

# summary
Inferred base version: v0.12.5
Suggested version: v0.13.0

@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #498 (1127e28) into main (2028828) will decrease coverage by 0.18%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
- Coverage   81.69%   81.50%   -0.19%     
==========================================
  Files          27       27              
  Lines        2267     2282      +15     
==========================================
+ Hits         1852     1860       +8     
- Misses        316      321       +5     
- Partials       99      101       +2     
Impacted Files Coverage Δ
run.go 74.39% <0.00%> (-1.39%) ⬇️
flags.go 90.17% <77.77%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vearutop vearutop requested a review from nhatthm August 30, 2022 21:04
@vearutop vearutop merged commit c35ea0b into main Aug 31, 2022
@vearutop vearutop deleted the test-flags branch August 31, 2022 08:17
laurazard pushed a commit to laurazard/godog that referenced this pull request Sep 11, 2022
…ber#498)

* Remove deprecation from flags, update example to use CLI flags

* Add comment to ShowHelp option

* Fix test

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants