[
https://issues.apache.org/jira/browse/KNOX-3335?focusedWorklogId=1024810&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1024810
]
ASF GitHub Bot logged work on KNOX-3335:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Jun/26 07:18
Start Date: 12/Jun/26 07:18
Worklog Time Spent: 10m
Work Description: Raghav-Mah3shwari opened a new pull request, #1260:
URL: https://github.com/apache/knox/pull/1260
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.
Issue Time Tracking
-------------------
Worklog Id: (was: 1024810)
Time Spent: 1h 20m (was: 1h 10m)
> Add pylint pre-push linting for .github/workflows/tests Python integration
> tests
> --------------------------------------------------------------------------------
>
> Key: KNOX-3335
> URL: https://issues.apache.org/jira/browse/KNOX-3335
> Project: Apache Knox
> Issue Type: Improvement
> Reporter: Raghav Maheshwari
> Priority: Major
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Add local pylint checks for Python files under {{.github/workflows/tests/}}
> so modified integration test code is validated before push. Pylint should run
> only on changed files in that directory, not across the whole Knox codebase.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)