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

Enchanced features filter #2134

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

epszaw
Copy link
Member

@epszaw epszaw commented Sep 6, 2022

🤔 What's changed?

The PR introduces runtime filters to enhance specs filtering not only be path or scenario, but by any Pickle message field:

module.exports = {
  default: {
    include: (pickle) => pickle.tags.includes('foo'),
    exclude: (pickle) => pickle.id === '...',
  }
}

⚡️ What's your motivation?

With the change we can use some good Allure features such as re-run with for cucumber-js.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

I'm not sure about the place where I added the fields. I decided to place them into IRunOptions.runtime because we use them in the runtime.

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

@coveralls
Copy link

coveralls commented Sep 6, 2022

Coverage Status

Coverage increased (+0.003%) to 98.239% when pulling 1165e5e on lamartire:enchanced-features-filter into 01368ca on cucumber:main.

@epszaw epszaw marked this pull request as ready for review September 6, 2022 15:55
@davidjgoss
Copy link
Contributor

Thanks for raising @lamartire

We've been working on a plugins mechanism recently and the use case of "filter/order pickles in a custom way" is one that we identified would be a good fit to enable via plugins.

I just want to understand your use case a bit better though - from some of the things you've said, it seems like you might be running Cucumber programatically as part of a bigger framework, is that the case?

@epszaw
Copy link
Member Author

epszaw commented Sep 7, 2022

Thanks for raising @lamartire

We've been working on a plugins mechanism recently and the use case of "filter/order pickles in a custom way" is one that we identified would be a good fit to enable via plugins.

I just want to understand your use case a bit better though - from some of the things you've said, it seems like you might be running Cucumber programatically as part of a bigger framework, is that the case?

We want to create seamless integration for allure and cucumber-js and one of the most important features is filtering specs by unique predicate (much more specific, than path, or name) when we need to perform re-run.

Plugins could be the solution, as far as I see. Could you please share some details about the API to estimate a sense of the PR? :)

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