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

Add routing stategy conflict integration test #699

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Add routing stategy conflict integration test #699

merged 1 commit into from
Jun 17, 2024

Conversation

maksymvavilov
Copy link
Contributor

Adds a new integration test to ensure we deal correctly with the situation when two policies will have conflicting strategies for the same host

@maksymvavilov maksymvavilov requested a review from a team as a code owner June 11, 2024 13:03
@maksymvavilov maksymvavilov linked an issue Jun 11, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.01%. Comparing base (ece13e8) to head (250cdbc).
Report is 122 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #699      +/-   ##
==========================================
+ Coverage   80.20%   83.01%   +2.80%     
==========================================
  Files          64       76      +12     
  Lines        4492     5793    +1301     
==========================================
+ Hits         3603     4809    +1206     
- Misses        600      649      +49     
- Partials      289      335      +46     
Flag Coverage Δ
bare-k8s-integration 4.64% <ø> (?)
controllers-integration 72.54% <ø> (?)
gatewayapi-integration 11.10% <ø> (?)
integration ?
istio-integration 56.55% <ø> (?)
unit 32.89% <ø> (+2.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) 71.42% <ø> (ø)
api/v1beta2 (u) 93.58% <100.00%> (+2.16%) ⬆️
pkg/common (u) 88.13% <ø> (-0.70%) ⬇️
pkg/istio (u) 73.88% <ø> (-0.03%) ⬇️
pkg/log (u) 94.73% <ø> (ø)
pkg/reconcilers (u) ∅ <ø> (∅)
pkg/rlptools (u) 83.97% <ø> (+4.51%) ⬆️
controllers (i) 81.93% <85.69%> (+5.13%) ⬆️

see 33 files with indirect coverage changes

Copy link
Member

@mikenairn mikenairn left a comment

Choose a reason for hiding this comment

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

Test seems fine. Some thoughts, but don't have to block:

  • It might be good to document the test a bit more, it's on the more complex side and won't be immediately obvious looking at it, especially in a few weeks, what it is testing.
  • I'd avoid using https listeners unless you are testing https (Doens't really make any difference since we are mocking the gateway status anyway, just looks like it's important to the test when i see it)
  • I'd avoid using multicluster.MultiClusterIPAddressType unless you are writing a test to explicitly test that. Most of our tests now should just use the normal gateway status since that is what we now use in all deployment cases (distributed dns) with the OCM integration being lower priority for now.

})),
)
// long timeout in a separate assertion - this avoids the test from being flaky: sometimes policy needs more time to become enforced
}, TestTimeoutLong, TestRetryIntervalMedium).Should(Succeed())
Copy link
Member

Choose a reason for hiding this comment

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

How long do we expect this to take? Does Enforced being true only get set once the record is ready?

Copy link
Contributor Author

@maksymvavilov maksymvavilov Jun 14, 2024

Choose a reason for hiding this comment

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

Yes, Enforced can only be set once it is Ready. On my local runs from 2-3 to 12 seconds (that section). The test itself usually around a minute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated test:

  • added more comments
  • using the HTTP listener
  • using casual IP address

@maksymvavilov maksymvavilov merged commit eabd231 into main Jun 17, 2024
26 checks passed
@maksymvavilov maksymvavilov deleted the gh-606 branch June 17, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

DNSPolicy: Add routing strategy type conflict test
2 participants