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

omit filtered-out pickles from counts, filters #273

Merged
merged 9 commits into from
Sep 13, 2022

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Aug 24, 2022

🤔 What's changed?

When considering pickles, for things like stats and search filters, omit any that don't have a corresponding test case, meaning they were never meant to be executed in this test run.

This would intentionally not omit pickles that were skipped via return 'skipped' etc, or pickles that were supposed to be run but never were because of fail fast behaviour or an error.

⚡️ What's your motivation?

Fixes cucumber/html-formatter#49. Pickles that were filtered out on the basis of location, name, or tags would show up in the stats as unknown. They should just be omitted.

On the linked issue there is some discussion of listing or otherwise noting the filtered-out scenarios. I think that's a good idea but keeping this change to just the fix as I think that's valuable enough in itself.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

Notes

Testing is a bit scrappy. I copied some messages from an example test run of cucumber-js. Really this should be generated on the fly by fake-cucumber, but it would need to have filtering capabilities added; I'll pick this up separately.

Looking at these components again highlights to me that they could benefit from being more React-y e.g. tucking away logic in hooks, keeping component code mostly about display. This could benefit custom component authors as well if we exposed some useful hooks. I'll raise a separate issue for that and maybe do a little POC.

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

@@ -27,6 +27,11 @@ export class EnvelopesQuery {
public getTestRunFinished(): messages.TestRunFinished | undefined {
return this.find((envelope) => !!envelope.testRunFinished)?.testRunFinished
}

// TODO add to cucumber query
Copy link
Contributor Author

@davidjgoss davidjgoss Aug 24, 2022

Choose a reason for hiding this comment

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

I'll raise a PR for cucumber-query. It can do this much more efficiently because it already has a map of pickle -> test case.

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.

Exclude 'unknown' scenarios from html report
2 participants