Skip to content
New issue

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

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

Already on GitHub? Sign in 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
Projects

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.

@eerkunt eerkunt added this to To do in Task Queue via automation Mar 22, 2022
@eerkunt eerkunt moved this from To do to In progress in Task Queue Mar 22, 2022
@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.

@eerkunt eerkunt moved this from In progress to Released in Task Queue Mar 28, 2022
@nwsparks
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Task Queue
Released
Development

No branches or pull requests

2 participants