Support for passing multiple tags as AND selection
See original GitHub issueHello,
It appears the bahavior of multiple --tags is like
“run all tests with this tag OR the other tag”.
in our case we have tags like: prod, stage, e2e, integration, and a lot other specific parts of the application
How to run only prod integration tests for example (not all integration tests have a prod tag for example)?
I would expect from running --tag prod --tag integration to run all tests that have prod AND integration as tags, not either or.
Edit: I have checked the implementation:
// filematcher
containsTag : function(moduleTags, tags) {
// my proposal > go through defined tags and check if all are in testfile
return tags.every(function (testTag) {
return (moduleTags.indexOf(testTag) > -1);
});
// current implementation > checks if one of the defined tags is in testfile
return moduleTags.some(function (testTag) {
return (tags.indexOf(testTag) > -1);
});
},
Depends on how it is intended to work. Probably could also make it switchable to “or | and” behavior, what’s your suggestion. If you prefer the AND, I would create a PR.
Regards, Markus
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:27 (7 by maintainers)
Top Results From Across the Web
How can I add multiple tags as optional parameters?
Adding multiple tag parameters can be achieved by separating each tag (sometimes with numeric value) with a comma, to the end of the...
Read more >Dcucumber.options, how to have multiple tags - Stack Overflow
Is there a way to pass in multiple tag names with cucumber run-time options? maven · cucumber-jvm · Share.
Read more >Cucumber Tags - Tools QA
Cucumber tagging gives us the capability to choose what we want with the help of ANDing and ORing. Tags that are comma-separated are...
Read more >Selecting items in Multiple tags - 1Password Community
I have been working on migrating my vault of 2k + items, mostly organized in folders, to the new system, using tags.
Read more >Wrap multiple tags at once - Display & Video 360 Help
Select up to 200 creatives you want to add wrappers to, making sure to only select Standard creatives that are synced from Campaign...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The
--tag-filterargument is an interesting idea, however it’s a little bit complicated for this use-case. I think we could initially solve this by making the--tagargument do an AND inclusion if a comma-separated list is supplied (as discussed in #1998). This will also be consistent to how--skiptagsworks and we might also introduce the--tagsargument as an alias.Also I’m afraid the maintainer has fled to the south of Spain for the time being.