Allow filtering of tags using AND rather than OR
Is there an existing issue for this?
- [x] I have searched the existing issues and didn't find mine.
Steps to reproduce
Based on the docs https://docs.maestro.dev/cli/tags multiple matching should act as AND
Have four flow files...
appId: com.example.app
tags:
- regression
- smoke
---
- launchApp
- tapOn: "text:SomeElementOnScreenA"
appId: com.example.app
tags:
- regression
- experience
---
- launchApp
- tapOn: "text:SomeElementOnScreenB"
appId: com.example.app
tags:
- experience
- smoke
---
- launchApp
- tapOn: "text:SomeElementOnScreenC"
appId: com.example.app
tags:
- regression
---
- launchApp
- tapOn: "text:SomeElementOnScreenD"
Run maestro with maestro test --include-tags="regression,experience" .
Actual results
All 4 are executed.
Expected results
Only flow_B.yaml should be executed, as it is the only flow containing both the regression and experience tags.
About app
Nothing specific about this app
About environment
nothing specific
Logs
Logs
[Failed] flow_A (1s) (Unable to launch app com.example.app: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
Simulator device failed to launch com.example.app.
Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.example.app" failed.
)
[Failed] flow_D (1s) (Unable to launch app com.example.app: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
Simulator device failed to launch com.example.app.
Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.example.app" failed.
)
[Failed] flow_C (1s) (Unable to launch app com.example.app: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
Simulator device failed to launch com.example.app.
Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.example.app" failed.
)
[Failed] flow_B (1s) (Unable to launch app com.example.app: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
Simulator device failed to launch com.example.app.
Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.example.app" failed.
)
4/4 Flows Failed
Maestro version
1.40.2
How did you install Maestro?
install script (https://get.maestro.mobile.dev)
Anything else?
This is bug with test filtering not with running tests.
My reading of the docs is different. Look at the worked example in https://docs.maestro.dev/cli/tags#filtering
If they use --include-tags=dev,pull-request , both flows will run.
Where you expect an AND is where you use tags in the config alongside tags in the CLI (effectively double-filtering)
How would I go about including tests that match both of them. Is there a way?
@Fishbowler I also see it as intended behavior, we have the same reading of the docs, but I was just thinking if maybe it's worth a feature request for more filtering options directly in the CLI, like for example:
-
--require-all-tags=dev,pull-request --require-no-tags=tagA,tagB -
--include-all-tags=dev,pull-request --exclude-all-tags=tagA,tagBsame thing, but maybe better parity as--include-tagsbehavior is equal to include-any-tags, the any is implicit -
--all-include-tags=dev,pull-request --all-exclude-tags=...kinda the same as 2. -
--required-include-tags=dev,pull-request --required-exclude-tags=... - or maybe like
--flags=someOf(tagA,tagB),noneOf(TagD,TagE),allOf(dev,pull-request)for an alternative api for advanced filtering, such complex filtering may be an code/architecture smell, but I feel like it would be a good thing to be able to do so, I see myself using--flags=noneOf(TagC),allOf(dev,something),someOf(performance,ddos)
I think the 2nd one looks easiest to document and explain to new users and existing users.
That proposal suggests no change to exclusions?