This document outlines how to contribute to the Kuadrant testsuite. Before contributing, ensure you have reviewed the README for details on running tests, configuration, and environment requirements.
The Kuadrant testsuite accepts contributions from forks, including from contributors outside the Kuadrant or Red Hat organisation.
Contributors must:
- Fork the repository
- Create feature branches in their own fork (not in the main repo)
- Open a Pull Request from <user>/testsuite:<branch> → Kuadrant/testsuite:main
Note for external contributors: If you are contributing from outside Red Hat, you will need to run the tests on a Kubernetes cluster that does not require internal VPN access. A local KIND cluster (or any accessible Kubernetes cluster) is supported. Tests can be run either locally with Python/Poetry or via the container image. Refer to the README for more details on running tests.
Fork the repository first, then clone and navigate into your fork:
git clone git@github.com:<your-username>/testsuite.git
cd testsuiteAdd the upstream remote to easily pull the latest changes from the main repository:
git remote add upstream git@github.com:Kuadrant/testsuite.gitTo prevent pushing to upstream, configure it as fetch-only:
git remote set-url --push upstream no_pushYou can verify your remote configuration with git remote -v. You should see that you can only push to origin (your fork):
origin git@github.com:<your-username>/testsuite.git (fetch)
origin git@github.com:<your-username>/testsuite.git (push)
upstream git@github.com:Kuadrant/testsuite.git (fetch)
upstream no_push (push)Test Naming Conventions:
- Test files use the pattern
test_<feature>.py(e.g.,test_authorino_metrics.py) - Test functions must use the
test_prefix and clearly describe the behaviour being tested (e.g.,test_dnspolicy_removal) - Fixture names should be short, lower-case, and reflect their purpose (e.g., gateway, route, authorization)
- Parametrised tests should use meaningful parameter IDs (ids=) to improve readability in test output
Common Testing Patterns:
- Every test and fixture should include a meaningful docstring
- Mark tests appropriately with pytest markers (
@pytest.mark authorino,@pytest.mark.limitador, etc.) - Use
autouse=Trueon fixtures when resources should be automatically applied before tests - Use
request.addfinalizer()to ensure cleanup/teardown of resources - Follow policy lifecycle:
create → configure → commit → wait_for_ready → delete
Test Organization:
singlecluster/for single-cluster scenariosmulticluster/for multi-cluster scenarios- Group tests by feature area (authorino, limitador, gateway, etc.)
Before committing your changes, make sure the code is properly formatted, and all commit checks pass. Otherwise, your pull request may fail the GitHub Actions Code Static Analysis checks.
Reformat code:
make reformatThis runs ‘black’ through Poetry to automatically format all source files according to the project’s code style.
Commit acceptance:
make commit-acceptanceThis performs a final validation before committing by running:
- Black in check mode for code formatting
- Pylint for linting and code quality
- Mypy for static type checking
Cleanup:
Once you’re done testing, if any resources created during the tests remain in the cluster, you can clean them up by running:
make clean1. Stage changes:
To add all files:
git add .Or stage specific files:
git add <filename1> <filename2> 2. Commit with sign-off and GPG signature:
git commit -s -S -m "Your commit message here"- -s adds a Signed-off-by line (required for GitHub Actions checks such as DCO compliance)
- -S signs the commit with your GPG key for verified commits
- We also follow the conventional commits format for commit messages
If you make additional changes, or if a reviewer requests updates, or if your commit fails the commit-acceptance checks, do not create a new commit. Instead, amend the previous commit to keep the history clean (we typically prefer one commit per feature/fix).
To amend the previous commit and edit the message:
git commit --amend -s -STo amend the previous commit without changing the existing message:
git commit --amend -s -S --no-editIf multiple commits are created during development, they should be squashed into a single commit before the PR is merged.
3. Push to your branch:
git push origin <branch-name>After amending a commit that was already pushed, you must force-push to update the branch:
git push --force-with-lease4. Open a Pull Request:
- You can create the PR either directly from your fork or by navigating to the Pull Requests tab in the main repository
- Click “Compare & pull request” (GitHub usually shows this automatically)
- Ensure the target is Kuadrant/testsuite:main and the source is your-fork:<branch>
- Add a clear conventional commit based title and description, then submit the PR
- Read more https://docs.github.com/en/pull-requests/collaborating-with-pull-requests
5. Pull Request Review:
Before a PR can be merged into main, it requires:
- Approval from two maintainers
- No pending change requests
- All review conversations resolved
- All automated checks passing