question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for passing multiple tags as AND selection

See original GitHub issue

Hello,

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:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
beatfactorcommented, Jan 25, 2019

The --tag-filter argument 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 --tag argument do an AND inclusion if a comma-separated list is supplied (as discussed in #1998). This will also be consistent to how --skiptags works and we might also introduce the --tags argument as an alias.

1reaction
beatfactorcommented, Aug 10, 2018

Also I’m afraid the maintainer has fled to the south of Spain for the time being.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found