Cucumber tags - execute ONLY features that have 2 specific tags - tags

I want to tag feature files in a manner that tells me it is set up to run in production or development environments.
I want to be able to run features that have BOTH #SMOKE and #PROD tags that don't mean I want all features that have #SMOKE and all #PROD I want ONLY those features that have BOTH of those tags.
Is there a way to do that?

so this syntax makes no sense to me but this does work:
-Dcucumber.options='--tags #BVT --tags #PROD'

Related

Github Actions badge.svg custom message

In my README.md I want to see automated tests results, e.g. something like:
[TestJob: failing] [TestJob Stats: 40 passed, 1 failed, 10 skipped, took 126 sec.]
There are existing workflows that can do this, e.g. https://github.com/marketplace/actions/dynamic-badges, BUT I'm on private enterprise repo, gist is disabled, and any content is not publicly visible, and requires token.
I figured I have two options.
Option1 - update README.md via e.g. bash script after execution, as part of the GitHub Action job.
Option2 - Find a way to customize the default badge.svg message.
Before I jump into spending time figuring out how to do option1, I want to ask - is there way to somehow relay / alternate the result text of the default badge.svg, currently it simply states "failing" passing" or "no status".

Using Regex to identify Entity on a Google Action Intent

I have this Intent on Google Actions with a couple of utterances:
and I'm using one of the default system types:
The Bank Account should always be 8 digits so I was thinking if I could use Regex on Google Actions to identify this exact entity when typed by the user.
If yes, how exactly?
Can I just create an utterance with Regex like this: \d{8}
Should I "highlight" as Parameter just like I did with the two given examples as well?
Thanks,
While this is not visible in the Actions Console, it is something that can be done if you download the project to a local environment using gactions.
You can create a new Type in under custom/types. You will use create RegularExpression Entities.
regularExpression:
entities:
# `bankNumber` is your parameter name. It can be custom.
bankNumber:
regularExpressions:
- \d{8} # In the `re2` syntax
Then you'll need to re-upload your project to the Actions Console with gactions push and gactions deploy preview.

How to Tag a branch Automatically in Azure DevOps using extension (Tag/Branch Git On Release)

With Azure DevOps release pipeline I'm planning to tag my brach Automatically by using the below extension which was created by Micheal Barry Tag\Branch Git on Release. See the below image:
I'm a bit wondering how to customize Tag name as UAT_$(date:yyyyMMdd)$(Rev:.r). Since this has limited documentation, this is how I try to add(See below)
How can I achieve this? Also, I'm more interested in how to fill these advanced options for this extension.
The $(date:yyyyMMdd)$(Rev:.r) is only supported in BuildNumber (Options=>Build Number Format) and ReleaseNumber (Options=>Release Name format). So if you put $(date:yyyyMMdd)$(Rev:.r) directly in Static Tag Name, the task can't evaluate its value.
Here're several directions to do what you want:
Use $(date:yyyyMMdd)$(Rev:.r) as release name format.
Then use UAT_$(Release.ReleaseName) in Static Tag Name input.
The result:
PS: If you set build pipeline as release pipeline's artifact source, you can also use $(Build.BuildNumber)/$(Build.DefinitionName) in your Release name format.
2.If you prefer to use Release-$(date:yyyyMMdd)$(Rev:.r) as release name format. Now since what you want is UAT_xxx, you need to use the Regex option:
Assuming your release name's instance is Release-20200518.5, now the tag would be UAT_20200518.5 if you configure the task following my inputs above.
In addition:
When release name format is $(date:yyyyMMdd)$(Rev:.r), you releases would be:
You can choose to use the Static Tag Name, check #1 above.
And when the name format is Release-$(date:yyyyMMdd)$(Rev:.r), you releases would be:
You should use regex option in that third-party task, check #2 above. About what is Regex see here, also there's many documents/blogs online about Regex topic...
You are using the wrong task in your pipeline. Would suggest using the git tag task, it works just fine to me and you can use your naming in the tag field
Git Tag Task
I find this extension much easier to setup and its satisfying our needs. So basically my git tag=assembly version. I am doing this every time we have a release on production environment(change assemblyInfo information and store that in Variable in the build definition). There are set of tasks on the marketplace to allow read from asemblyInfo and write to it. For the git tag task i just use the previously set Tag variable which basically is incremented by one every new release. You can check more in the pictures bellow
So i am actually just adding simple tag to mirror my assemblyVersion but in the tag message i am also adding my build informations that looks like this $(build.buildNumber)-$(Tag)
If you want to have a deeper look into azure devops predefined variables you can do that here Use predefined variables

Azure Devops Pipeline trigger ignore paths when a tag is triggered

I have two build pipelines which build my client and API, but when I create a new git tag, both builds are triggered, even though the tag may only related to changes based on my client code.
front-end-build-ci.yml
trigger:
branches:
include:
- master
tags:
include:
- refs/tags/*_prodrelease*
paths:
include:
- Clients/*
exclude:
- Api/*
api-build-ci-yml
trigger:
branches:
include:
- master
tags:
include:
- refs/tags/*_prodrelease*
paths:
include:
- Api/*
exclude:
- Clients/*
Regular commits work as expected (i.e. client code triggers client build), and I have tried multiple variations of excluding paths to no avail.
Should tag filtering be ignoring paths, or should it work in the same way as branches?
A workaround would be to have more descriptive tags (i.e 20200326_prodrelease_api), but I'm trying to avoid needing two tags if both the api and client are ready for production.
When I create a new git tag, both builds are triggered, even though
the tag may only related to changes based on my client code.
Should tag filtering be ignoring paths, or should it work in the same
way as branches?
Sorry but I'm afraid what you encountered is the expected behavior of CI triggers. And yes, your guess is right that tag filtering is ignoring paths when tags is used in combination with branch filters that include file paths.
Please check the Note tip in official document:
If you specify tags in combination with branch filters that include file paths, the trigger will fire if the branch filter is satisfied and either the tag or the path filter is satisfied.
Cause of the issue:
That's why in your scenario both builds are triggered. Since you now use tags in combination with branch filters and file paths filters, both branch filter ok + tag ok and branch filter ok + path ok can trigger the build.
Behavior:
When not creating the tag, branch filter ok + path ok will work like client code triggers client build and api code triggers api build. And when creating the specific tag, cause branch filter ok + tag ok is always satisfied, it will trigger both two builds.
Just as you mentioned above, using more descriptive tags as a workaround is not a bad choice in this situation. In addition, if you do want the feature like making the three filters work at the same time, feel free to share your feedback by suggesting a feature in our User Voice Forum. Share the link here and members interested in that would vote for you.

How not to have 'version=GBmaster' in Azure DevOps links

Azure DevOps urls to files and to wiki entries contain &version=GBmaster and &wikiVersion=GBwikiMaster respectively.
Is it possible to configure DevOps not to append it?
Today I get:
https://myorg.visualstudio.com/MyProject/_git/MyRepo?path=%2Fsrc%2FMyFile.cs&version=GBmaster
https://dev.azure.com/rbtech/Redback/_wiki/wikis/MyOrg.wiki?pagePath=%2MyPage&pageId=204&wikiVersion=GBwikiMaster
I wish for:
https://myorg.visualstudio.com/MyProject/_git/MyRepo?path=%2Fsrc%2FMyFile.cs
https://dev.azure.com/rbtech/Redback/_wiki/wikis/MyOrg.wiki?pagePath=%2MyPage&pageId=204
This is the default behavior of AzureDevop basically &version/ &wikiversion is denoted which branch the code/wiki is showing in the UI. Even if you don't provide the Version AzureDevOps will automatically append it to indicate which branch is chosen.
Let's say in your repo you have multiple branches means like master/ develop then based on the branch you choose the &version will change automatically like &version=GBmaster or &version=GBdevelop if you don't provide the default branch will be appended in the query.
Is it possible to configure DevOps not to append it?
No, there isn't a way to configure it. It's the expected behavior as Jayendran described, it's a tag which marks the file version from which branch.
If you want to see the contents of the files without the &version=GBmaster, then you can try call the REST API : Items - Get
For example:
https://{organization}.visualstudio.com/{Project}/_apis/git/repositories/{Repository ID}/items?path=WAP/WAP.Tests/Properties/AssemblyInfo.cs