Open craigthackerx opened 3 years ago
Update, looks like I have raised a duplicate issue on better inspection.... #458
Happy to close unless anyone has any feedback or questions!
@craigthackerx,
When it contains something drills down, while When it has something does not.
Only THEN steps should drill down, hence the deprecation of "When it has something." I see that this's not reflected well in the documentation, as we have this issue come up every once in a while. I will add more information about it.
Meanwhile, can you try using the following:
Scenario Outline: Naming Standard on all available resources
Given I have <resource_name> defined
When it has name <name_key>
Then it must have <name_key>
Then its value must match the "lb-.*" regex
Examples:
| resource_name | name_key |
| azurerm_lb | name |
Here, I first filter with the WHEN step, then I drill down to the value with the appropriate THEN step.
General Info:
Host OS - RedHat 8.4. Terraform-Compliance Version - Latest. Terraform Version - v15.4 AzureRM Provider - v2.61.0 Python Version - v3.9.5. Using Azure DevOps as CI/CD tool.
I am also using modules for some of my terraform.
Hi,
I am looking to get some help with an issue I'm having. Full disclosure - I don't really have much experience with QA, BDD or testing in general.
I am trying to follow the examples on the website to write an Azure based naming convention. The example you have for AWS works in Azure as follows:
This results in the following:
As you can see and as per the docs, I have a depreciation error for using
When it contains
instead ofWhen it has
. The above works great, and when I try to change my naming convention to something likehello-lb
then it fails the build - exactly what I want.I convert the .feature file to represent this to fix the warning:
And I get the following error:
I initially thought this was a syntax error on my part, and changed my .feature to as follows:
With the main difference being I am not specifying
name
before<name_key>
As you will see, after the syntax error, my
name
key isn't being filtered, and instead, all the properties such as as the Azure Load Balancerprivate_ip_address_version
(which is defined asIPv4
in the module) is being searched as part of the policy, when I only really care about thename
key.Any ideas as to what's going on?