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

Resource Extensions added #940

Merged
merged 1 commit into from
Aug 18, 2022
Merged

Resource Extensions added #940

merged 1 commit into from
Aug 18, 2022

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Aug 12, 2022

I extended the terratest abstraction to have easier access to resources like DNSEndpoint, or GSLB. This way I can, for example, compare the targets in DNSEndpoints with the expected values, so we can thus simplify code execution and avoid possible racing.

see canges in TestWeightsExistsInLocalDNSEndpoint.

I can do:

  • easily work with External and Local DNS Endpoints, could reapply by ingress resource
  • instanceUS.ReapplyIngress(<ingress path>)
  • instanceEU.WaitForExternalDNSEndpointExists()
  • instanceEU.WaitForLocalDNSEndpointExists()
  • instanceEU.Resources().GetExternalDNSEndpoint().GetEndpointByName(endpointDNSNameEU)
  • instanceEU.Resources().GetLocalDNSEndpoint().GetEndpointByName(host)
  • instanceEU.Resources().Ingress()
  • instanceEU.Resources().GslbSpecProperty("spec.ingress.rules[0].host")

I also added a new waiting function using Ticker class:

  • instanceUS.WaitForLocalDNSEndpointHasTargets(expectedTargets)

Signed-off-by: kuritka kuritka@gmail.com

I expanded the terratest abstraction to have easier access to resources like DNSEndpoint, or GSLB.
This way I can, for example, compare the targets in DNSEndpoints with the expected values, so
we can thus simplify code execution and avoid  possible racing.

see canges in `TestWeightsExistsInLocalDNSEndpoint`.

I can do:
 - easily work with External and Local DNS Endpoints, could reapply by ingress resource
  - `instanceUS.ReapplyIngress(<ingress path>)`
  - `instanceEU.Resources().GetExternalDNSEndpoint().GetEndpointByName(endpointDNSNameEU)`
  - `instanceEU.Resources().GetLocalDNSEndpoint().GetEndpointByName(host)`
  - `instanceEU.Resources().Ingress()`
  - `instanceEU.Resources().GslbSpecProperty("spec.ingress.rules[0].host")`

I also added a new waiting function using Ticker:
 - instanceUS.WaitForLocalDNSEndpointHasTargets(expectedTargets)

Signed-off-by: kuritka <kuritka@gmail.com>

WaitForExternalDNSEndpointExists, WaitForLocalDNSEndpointExists

waiting...

continueIfNotFound

test x1

Signed-off-by: kuritka <kuritka@gmail.com>
@kuritka kuritka marked this pull request as ready for review August 15, 2022 17:36
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abstractions look great!

@kuritka kuritka merged commit f924a0c into master Aug 18, 2022
@kuritka kuritka deleted the sync2 branch August 18, 2022 08:17
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

Successfully merging this pull request may close these issues.

3 participants