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

Match all tags in filter #60

Closed
Tracked by #30
Saghen opened this issue May 13, 2022 · 10 comments
Closed
Tracked by #30

Match all tags in filter #60

Saghen opened this issue May 13, 2022 · 10 comments
Assignees
Labels
Type: Enhancement Improving an existing feature

Comments

@Saghen
Copy link

Saghen commented May 13, 2022

Description

Currently when providing multiple tags to the config.filters.tags, any test that matches at least one of the tags will be run. It would be helpful if we could have the option to run tests that match all of the tags. I originally built a plugin to achieve this behavior via .skip() but the default reporter logs skipped tests to the console, as it should of course. So alternatively, would it be possible to filter out a test in a plugin so that custom filters can be implemented?

Package version

"@japa/expect": "^1.1.4",
"@japa/run-failed-tests": "^1.0.7",
"@japa/runner": "^2.0.7",
"@japa/spec-reporter": "^1.1.12",

Relevant Information

async function (_, runner) {
  runner.onSuite((suite) => {
    suite.onTest((test) => {
      if (!doesTestMatchAllTags(test, tags)) test.skip()
    })
    suite.onGroup((group) => {
      for (const test of group.tests) {
        if (!doesTestMatchAllTags(test, tags)) test.skip()
      }
    })
  })
}
@thetutlage thetutlage self-assigned this May 17, 2022
@thetutlage thetutlage added the Type: Enhancement Improving an existing feature label May 17, 2022
@thetutlage
Copy link
Collaborator

Hey! Yup, seems like we need to open a few more APIs to allow filtering tests via plugins. I have added it to my todo

@stale
Copy link

stale bot commented Jul 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Jul 16, 2022
@thetutlage thetutlage removed the Status: Abandoned Dropped and not into consideration label Jul 19, 2022
@stale
Copy link

stale bot commented Sep 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Sep 17, 2022
@stale stale bot closed this as completed Sep 25, 2022
@Saghen
Copy link
Author

Saghen commented Sep 26, 2022

@thetutlage Might be worth it to only enable the stale bot on issues with a tag such as not enough info. It seems there were a few other issues in this repo that were needlessly closed

@thetutlage thetutlage removed the Status: Abandoned Dropped and not into consideration label Sep 30, 2022
@thetutlage
Copy link
Collaborator

The current workflow works great for us. If an issue needs attention, usually the creator of the issue will remind us about it.

@thetutlage thetutlage reopened this Sep 30, 2022
@stale
Copy link

stale bot commented Nov 29, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Nov 29, 2022
@Saghen
Copy link
Author

Saghen commented Nov 29, 2022

Friendly reminder that I'd still appreciate this feature

@stale stale bot removed the Status: Abandoned Dropped and not into consideration label Nov 29, 2022
@stale
Copy link

stale bot commented Jan 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Jan 29, 2023
@Saghen
Copy link
Author

Saghen commented Jan 29, 2023

Bump

@stale stale bot removed the Status: Abandoned Dropped and not into consideration label Jan 29, 2023
@stale
Copy link

stale bot commented Mar 30, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Abandoned Dropped and not into consideration label Mar 30, 2023
@stale stale bot closed this as completed Apr 6, 2023
@thetutlage thetutlage removed the Status: Abandoned Dropped and not into consideration label Jun 21, 2023
@thetutlage thetutlage reopened this Jun 21, 2023
thetutlage added a commit that referenced this issue Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improving an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants