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 section targeting tests for ratelimit policy #634

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

averevki
Copy link
Contributor

Refined #600 PR from @martinhesko

Closes #561

@averevki averevki added the Test case New test case label Feb 17, 2025
@averevki averevki requested a review from azgabur February 17, 2025 15:46
@averevki averevki self-assigned this Feb 17, 2025
Copy link
Contributor

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

Are the tescases from deleted limitador/route/... module preserved or they are no longer relevant?

@pytest.fixture(scope="module")
def rate_limit(cluster, blame, module_label, gateway):
"""Add a RateLimitPolicy targeting the specific Gateway Listener"""
rlp = RateLimitPolicy.create_instance(cluster, blame("limit"), gateway, "api", labels={"testRun": module_label})
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use GatewayListener.name if referencing the default name for listener api

def rate_limit(cluster, blame, module_label, route):
"""Add a RateLimitPolicy targeting the first HTTPRoute Rule"""
rate_limit = RateLimitPolicy.create_instance(
cluster, blame("limit"), route, "rule-1", labels={"testRun": module_label}
Copy link
Contributor

Choose a reason for hiding this comment

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

How does the route know about rule-1 and rule-2 section names?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test case New test case
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update RouteSelector tests to use SectionName
2 participants