Skip to content

Ambiguous step detection - add support to all formatters#648

Merged
Johnlon merged 6 commits intomainfrom
ambiguous_step_report_fixes
Oct 16, 2024
Merged

Ambiguous step detection - add support to all formatters#648
Johnlon merged 6 commits intomainfrom
ambiguous_step_report_fixes

Conversation

@Johnlon
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown

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
Copy Markdown
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)
Copy link
Copy Markdown

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
@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