Tags
You can add tags to your Flows files to later filter them in maestro cloud and maestro test commands. There is a couple of different use cases for this, but this is especially useful when you want to run some Flows at Pull Request time, and other Flows before a version release, for example.
Adding Tags
You can provide a list of tags in the tags field at the root of your Flow file. Like this:
appId: com.example.App
tags:
- nightly-build
- pull-request
---
- launchAppFiltering
In maestro cloud and maestro test commands, you can specify either --include-tags or --exclude-tags parameters to filter them.
The --include-tags will look for all flows containing the provided tag; it doesn't matter if those Flows also have other tags. On the other hand, the --exclude-tags parameter will remove from the list of Flows run any Flow that contains the provided tags. These options can be used together and they perform an AND operation.
Example
Let's say a user has two flows:
# flowA.yaml
appId: com.example.app
tags:
- dev
- pull-request# flowB.yaml
appId: com.example.app
tags:
- devIn the scenario above:
If they use
--include-tags=dev, flowA and flowB will run.If they use
--include-tags=dev,pull-request, both flows will run.If they use
--exclude-tags=pull-request, only flowB will run.If they use
--exclude-tags=devnone Flow will run.If they use
--include-tags=dev --exclude-tags=pull-request, only flowB will run.
Global tags
Instead of passing tags with each test or cloud command, you can also define default tags to be applied to each run. To do so, add the following to your config.yaml file (or create it if it is missing):
includeTags:
- tagNameToInclude
excludeTags:
- tagNameToExcludeNow, whenever you run a test folder the following will happen:
Only flows with a
tagNameToIncludeare going to runFlows with a
tagNameToExcludeare not going to run (even if they havetagNameToIncludeassigned to them)
When used in combination with --include-tags and --exclude-tags, global tags behaving as a union and will not be overwritten. Consider the following example:
maestro test --include-tags=tagA --exclude-tags=tagB workspaceFolder/The following behaviour should be expected:
Only flows that have both
tagAandtagNameToIncludeare going to runFlows that have either
tagBortagNameToExcludeare not going to run (regardless of whether they have bothtagAandtagNameToInclude)
Last updated
Was this helpful?
