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

Support Matching by Instance Name in Feature Files #4

Open
gfcredera opened this issue Sep 12, 2024 · 0 comments
Open

Support Matching by Instance Name in Feature Files #4

gfcredera opened this issue Sep 12, 2024 · 0 comments
Assignees

Comments

@gfcredera
Copy link
Collaborator

Description:

Note: This issue is related to the GitHub issue titled "Support Matching Hosts by Criteria in Feature Files". Both issues focus on improving the flexibility of instance matching in test scenarios. While this issue introduces support for matching by instance name, the other expands matching options to include criteria such as environment, tags, or specific attributes. These enhancements will complement each other to provide a more robust and dynamic testing framework.

Currently, test scenarios in feature files match instances using instance IDs or IP addresses. However, these identifiers can change over time, especially when instances are recreated through tools like Terraform. This makes maintaining test scenarios more difficult and error-prone.

To improve stability and clarity in test cases, the feature files should allow for matching by instance name instead of instance ID. This would provide a more consistent way to identify instances, even when their underlying IDs or IPs change.

Example of current scenario using instance ID:

  Scenario Outline: Hosts within development environment can
  successfully ping each other
    When host <hostA> pings host <hostB> with timeout 9 seconds
    Then the ping is successful

    Examples:
      | hostA                 | hostB           |
      | 'i-0ef8af428ece8e86d' | '172.31.24.6'   |
      | 'i-040d60025bde0fe7b' | '172.31.27.178' |

Desired scenario matching by instance name:

Scenario: Application Server can ping Database Server on Private IPv4 addresses, Public IPv4 address, Public IPv4 DNS, Private IP DNS name
    When Application Server pings Database Server on <addressType>
    Then the ping is successful

    Examples:
      | addressType              |
      | 'Private IPv4 addresses' |
      | 'Public IPv4 address'    |
      | 'Public IPv4 DNS'        |
      | 'Private IP DNS name'    |

This approach will improve readability and reduce the need for frequent updates to the test cases when infrastructure changes occur.

Tasks:

  • Implement support for instance name matching in feature files.
  • Allow matching for the following types of addresses and DNS names:
    • Private IPv4 address
    • Public IPv4 address
    • Public IPv4 DNS name
    • Private IP DNS name
  • Update existing scenarios to use instance names where appropriate.
@karthik21118701 karthik21118701 self-assigned this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants