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

Ambiguous step detection - add support to all formatters #648

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

Johnlon
Copy link
Member

@Johnlon Johnlon commented Oct 15, 2024

🤔 What's changed?

Previously "ambiguous" step reporting had been omitted for some of the formatters.
This change adds support for "ambiguous" steps to all formatters.

⚡️ What's your motivation?

Bug fix.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)
  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Worth scanning the test data file changes - ie "some_scenarios_including_failing"

📋 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.

Copy link

Go API Changes

# github.com/cucumber/godog
## compatible changes
Attach: added
Attachment: added
Attachments: added
ErrAmbiguous: added
StepAmbiguous: added

# github.com/cucumber/godog/formatters
## incompatible changes
Formatter.Ambiguous: added

# summary
Inferred base version: v0.14.1
Suggested version: v0.15.0

@Johnlon
Copy link
Member Author

Johnlon commented Oct 15, 2024

@vearutop - hi - further PR to the "ambiguous" step detection that adds full support to the formatters - as previously we only got to know about dupe steps from the test exit code.

errs := "\n\t\t" + strings.Join(matchingExpressions, "\n\t\t")
return nil, fmt.Errorf("%w, step text: %s\n\tmatches:%s", ErrAmbiguous, text, errs)
errs := "\n " + strings.Join(matchingExpressions, "\n ")
return nil, fmt.Errorf("%w, step text: %s\n matches:%s", ErrAmbiguous, text, errs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I want it. 😊

When will it be released?

@Johnlon Johnlon merged commit ecd2dfe into main Oct 16, 2024
5 checks passed
@Johnlon Johnlon deleted the ambiguous_step_report_fixes branch October 16, 2024 14:41
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