Skip to content

[devkit] Improved undefined example(s)#278

Open
luke-hill wants to merge 8 commits into
mainfrom
feature/enhanced_undefined_example
Open

[devkit] Improved undefined example(s)#278
luke-hill wants to merge 8 commits into
mainfrom
feature/enhanced_undefined_example

Conversation

@luke-hill

Copy link
Copy Markdown
Contributor

🤔 What's changed?

Update some of the undefined examples to include multi-snippet functionality, so as to prove the cucumber implementor is working well when the snippet generation is > 1 per scenario

⚡️ What's your motivation?

See above

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 💥 Breaking change (incompatible changes to the API)

♻️ 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.

@mpkorstanje

mpkorstanje commented Jun 1, 2026

Copy link
Copy Markdown
Member

I think it would be better if the existing tests didn't change and one undefined-multiple was added instead. It allows for a more gradual implementation of functionality and won't break any existing tests.

@luke-hill

Copy link
Copy Markdown
Contributor Author

@davidjgoss I think there's a bug here in fake-cucumber. It looks like when we have multiple steps that are undefined that whilst the snippet generation is working, the status of the subsequent steps is being reported as UNDEFINED. But I believe they should be SKIPPED

This doesn't affect the purpose of the tests here per se. But I think it's still wrong as/when I come to implement these once I'm at cckv30+

@luke-hill

Copy link
Copy Markdown
Contributor Author

closes #276

@luke-hill

Copy link
Copy Markdown
Contributor Author

I think it would be better if the existing tests didn't change and one undefined-multiple was added instead. It allows for a more gradual implementation of functionality and won't break any existing tests.

Will make this change in a couple of days. Notwithstanding the fake-cucumber issue as I think this is a bug here

@davidjgoss

Copy link
Copy Markdown
Member

@davidjgoss I think there's a bug here in fake-cucumber. It looks like when we have multiple steps that are undefined that whilst the snippet generation is working, the status of the subsequent steps is being reported as UNDEFINED. But I believe they should be SKIPPED

That was an intentional change in #239, and IIRC it was pointed out by @brasmusson that it works that way already in cucumber-ruby.

@luke-hill

Copy link
Copy Markdown
Contributor Author

I think at that time cucumber-ruby was somewhere between cckv20 and v22 compliant. It's currently cckv24 compliant and I'm working on the v26 compliance.

Are we saying that the current implementation is correct, or that we need to make a change. I'm a bit confused sorry

@davidjgoss

Copy link
Copy Markdown
Member

Are we saying that the current implementation is correct, or that we need to make a change. I'm a bit confused sorry

The current CCK behaviour is correct.

Comment thread devkit/samples/undefined-enumerable/undefined-enumerable.feature Outdated

Scenario: Steps before undefined steps are executed
Given an implemented step
And an implemented step

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can remove this line. I don't think it meaningfully tests anything related to undefined steps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed

@@ -0,0 +1,18 @@
Feature: Examples Tables - With Many Undefined Steps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this case is needed at all. Example tables are sugar for repeating the same scenario, which is already covered by the undefined-multiple scenario.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was a migration from something left out on the initial implementation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this rename needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not strictly, but it was a bug which was picked up (or will be picked up), so figure in a breaking change (Which this will be), adding this is fine.

Given an implemented step
And an implemented step
And a step that is yet to be defined
And another step that is also yet to be defined

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line looks like we're testing multiple scenarios in on scenario.

We can have two scenarios here, one with one step after an undefined step and one with multiple.

It's also not quite clear what we're testing here.

Either a second step after an undefined step will be skipped (not undefined) or a second undefined step after an undefined step is also undefined (not skipped). It should be clear from reading the scenario what will happen.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Will refactor this

@luke-hill luke-hill left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure when I'll get to this. But put some responses and some things I need to fix (Notes to self).

@@ -0,0 +1,18 @@
Feature: Examples Tables - With Many Undefined Steps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was a migration from something left out on the initial implementation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not strictly, but it was a bug which was picked up (or will be picked up), so figure in a breaking change (Which this will be), adding this is fine.

Given an implemented step
And an implemented step
And a step that is yet to be defined
And another step that is also yet to be defined

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Will refactor this


Scenario: Steps before undefined steps are executed
Given an implemented step
And an implemented step

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed

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.

3 participants