Skip to content

KNOX-3293: Add integration tests: health metrics JSON, KnoxLDAP preauth/extauthz paths, RemoteAuth extauthz#1194

Merged
hanicz merged 2 commits intoapache:masterfrom
Raghav-Mah3shwari:KNOX-3293
Apr 9, 2026
Merged

KNOX-3293: Add integration tests: health metrics JSON, KnoxLDAP preauth/extauthz paths, RemoteAuth extauthz#1194
hanicz merged 2 commits intoapache:masterfrom
Raghav-Mah3shwari:KNOX-3293

Conversation

@Raghav-Mah3shwari
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?
This PR adds integration tests under .github/workflows/tests that run against the Knox gateway in the workflow Docker Compose stack:

test_health.py — test_health_metrics_returns_json checks that GET /gateway/health/v1/metrics?pretty=true returns 200, a JSON Content-Type, and a parseable JSON object body.
test_knoxauth_preauth_and_paths.py — Covers KnoxLDAP preauth (401 without credentials / bad credentials; POST with valid credentials) and extauthz behavior when an additional path segment is not ignored (expects 404 vs treating it like the base extauthz URL).
test_remoteauth_extauthz_additional_path.py — Covers RemoteAuth extauthz: success with valid Basic auth and X-Knox-Actor-ID, additional path ignored when configured, 401 for bad credentials, and current behavior (500) when the Authorization header is missing.

How was this patch tested?
Built the workflow Knox image and ran the compose stack, then executed the integration test container (same flow as .github/workflows/tests/README.md).

Command (from the repo root, paths as in the README):

docker compose -f ./.github/workflows/compose/docker-compose.yml up --build --exit-code-from tests tests

Confirmed pytest collects and passes the new cases together with existing workflow tests (health ping, LDAP auth service, configs, remote auth, etc.).

Integration Tests
Yes. New/updated tests live under .github/workflows/tests:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Test Results

16 tests   16 ✅  1s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 303954a.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

@pzampino pzampino left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@hanicz hanicz merged commit 3bca5f1 into apache:master Apr 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants