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:
Filtering
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:
In 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=dev
none 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):
Now, whenever you run a test folder the following will happen:
Only flows with a
tagNameToInclude
are going to runFlows with a
tagNameToExclude
are not going to run (even if they havetagNameToInclude
assigned 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:
The following behaviour should be expected:
Only flows that have both
tagA
andtagNameToInclude
are going to runFlows that have either
tagB
ortagNameToExclude
are not going to run (regardless of whether they have bothtagA
andtagNameToInclude
)
Last updated