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

e2e test: basic #124

Merged
merged 1 commit into from
Nov 6, 2024
Merged

e2e test: basic #124

merged 1 commit into from
Nov 6, 2024

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Oct 28, 2024

This is a integration test to validate basic happy path.

The Wasm configuration defines a set of rules for *.example.com.

Two (rate limiting) services are being defined, namely limitadorA and limitadorB.

One actionSet is defined that has two actions.
Each action should hit the same limitador instance, decrementing the counter twice.

"services": {
  "limitadorA": {
    "type": "ratelimit",
    "endpoint": "limitador",
    "failureMode": "deny"
  },
  "limitadorB": {
    "type": "ratelimit",
    "endpoint": "limitador",
    "failureMode": "deny"
  }
},
"actionSets": [
{
    "actions": [
        {
            "service": "limitadorA",
            "scope": "a",
            "data": [
                {
                    "expression": {
                        "key": "a",
                        "value": "1"
                    }
                }
            ]
        },
        {
            "service": "limitadorB",
            "scope": "a",
            "data": [
                {
                    "expression": {
                        "key": "a",
                        "value": "1"
                    }
                }
            ]
        }
    ]
}
]

And a new limit configuration

- namespace: basic
  max_value: 30
  seconds: 60
  conditions:
  - "a == '1'"
  variables: []

The test will run one request and expect the counter to be decremented by two.
The counter starts with 30, so after the request, the counter should be 28.

Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
@eguzki eguzki marked this pull request as ready for review November 6, 2024 09:23
Base automatically changed from e2e-parallel-requests to main November 6, 2024 10:04
@eguzki eguzki merged commit 4e6b4e8 into main Nov 6, 2024
12 checks passed
@eguzki eguzki deleted the e2e-basic-test branch November 6, 2024 10:04
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.

2 participants