Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

using regex or wildcard in when stage. #602

Closed
nwsparks opened this issue Mar 7, 2022 · 5 comments
Closed

using regex or wildcard in when stage. #602

nwsparks opened this issue Mar 7, 2022 · 5 comments
Assignees
Labels

Comments

@nwsparks
Copy link

nwsparks commented Mar 7, 2022

Question:

I am trying to write a test that says when resources start with the address module.project1, they must have the tag project: project1

Ive tried quite a few different variations of this and it always returns SKIPPING: Could not find "module.project1.*" in "address" metadata.

Ive googled and searched past issues pretty extensively and haven't had any luck finding a solution. Sorry for having to ask this.

Feature: Ensure qtso tags are present

  @case-sensitive
  Scenario Outline: Ensure that specific tags are defined
    Given I have resource that supports tags defined
    When its address metadata is "module.project1.*" regex
    Then it must contain "<tags>"
    And its value must match the "<value>" regex

      Examples:
        | tags      | value   |
        | project   | project1 |
@eerkunt eerkunt self-assigned this Mar 7, 2022
@eerkunt
Copy link
Member

eerkunt commented Mar 22, 2022

This is definitely a required feature as it will also allow to write conditional tests based on the provider version. (e.g. the current case in AWS provider)

Looking into this now.

@nwsparks
Copy link
Author

awesome! another possibility i was thinking of here would be an @include tag to compliment the current @exclude.

@eerkunt
Copy link
Member

eerkunt commented Mar 22, 2022

Trying the concept in #608, after all tests passed will also create two more steps for

When its address metadata is "module.project1.*" regex

@eerkunt
Copy link
Member

eerkunt commented Mar 22, 2022

Latest version has this feature, let me know if that works for you.

@nwsparks
Copy link
Author

@eerkunt sorry for the delay. ive tested this and it's working for me as expected. thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants