KNOX-3335: Add pylint pre-push linting for .github/workflows/tests Python integration tests#1260
Merged
Merged
Conversation
…thon integration tests
smolnar82
approved these changes
Jun 12, 2026
Test Results22 tests 22 ✅ 2s ⏱️ Results for commit 08dc31d. |
Contributor
At least we know Let's wait for @moresandeep 's feedback and merge this change soon. Thanks, @Raghav-Mah3shwari , for your contribution! This is a cool addition to our Docker-based integration tests. |
Contributor
Author
|
sure @smolnar82 , thanks for the feedback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes were proposed in this pull request?
This PR adds pylint to the Python integration test pipeline so lint checks run before pytest in the Docker Compose tests container. If pylint fails, integration tests do not run.
Changes include:
Added pylint==4.0.5 to .github/workflows/tests/requirements.txt
Updated .github/workflows/compose/docker-compose.yml to:
Run pylint *.py after installing dependencies and before waiting for Knox / running pytest
Upgrade the tests container from python:3.9-slim to python:3.10-slim (required by pylint 4.x)
Fixed existing pylint violations across the integration test suite so the default pylint rules pass (10.00/10), including:
Module, class, and function docstrings
Line length, trailing whitespace, and trailing newline issues
Replaced broad except Exception with requests.exceptions.RequestException in test_health.py
Removed unnecessary f-strings and wrapped long lines in common_utils.py and test files
How was this patch tested?
Automated linting (local venv):
cd .github/workflows/tests
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pylint *.py
Result: 10.00/10
Docker Compose integration test workflow (local):
Build Knox runtime image (requires Maven artifacts in target/)
docker compose -f ./.github/workflows/compose/docker-compose.yml build knox-dev
Start Knox stack and run tests (pylint runs first inside the tests container)
docker compose -f ./.github/workflows/compose/docker-compose.yml up -d ldap knox
docker compose -f ./.github/workflows/compose/docker-compose.yml up --exit-code-from tests tests
Verified in the tests container output:
Dependencies install successfully
pylint *.py completes with score 10.00/10
Knox wait completes
pytest runs afterward
CI: The existing Apache Knox Docker Compose Tests GitHub Actions workflow (.github/workflows/tests.yml) will pick up the docker-compose change automatically on PRs.
Integration Tests
No new integration test cases were added. This change improves quality gates for the existing suite under .github/workflows/tests/.
Existing integration tests were updated only to satisfy pylint (docstrings, formatting, minor exception handling). Test behavior and assertions are unchanged.
UI changes
N/A — no UI changes in this patch.