Skip to content

KNOX-3296: Expand CI integration tests: health metrics, HSTS, and KnoxLDAP auth paths#1196

Merged
hanicz merged 3 commits intoapache:masterfrom
Raghav-Mah3shwari:KNOX-3296
Apr 10, 2026
Merged

KNOX-3296: Expand CI integration tests: health metrics, HSTS, and KnoxLDAP auth paths#1196
hanicz merged 3 commits intoapache:masterfrom
Raghav-Mah3shwari:KNOX-3296

Conversation

@Raghav-Mah3shwari
Copy link
Copy Markdown
Contributor

@Raghav-Mah3shwari Raghav-Mah3shwari commented Apr 9, 2026

What changes were proposed in this pull request?
This pull request extends .github/workflows/tests and the Docker Compose–based CI path so Knox is exercised with additional automated integration coverage:

test_health.py: Asserts /gateway/health/v1/metrics returns JSON (with and without pretty), checks top-level metric keys align with the Java health test expectations, and verifies /gateway/health/v1/ping responds with text/plain in addition to the existing ping and HSTS checks.
test_knoxauth_preauth_and_paths.py: Covers KnoxLDAP preauth (401 without or with bad credentials; 200 for POST/GET with valid credentials; x-knox-actor-username and group headers for admin) and verifies extauthz does not swallow unknown path segments (404 for a non-existent subpath).

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:

response = knox_get(url)
self.assertEqual(response.status_code, 200)
content_type = response.headers.get("Content-Type", "")
self.assertIn("text/plain", content_type)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you check for the actual content as well? (OK)

url = self.base_url + "gateway/health/v1/metrics"
response = knox_get(url)
self.assertEqual(response.status_code, 200)
self.assertIn("application/json", response.headers.get("Content-Type", ""))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would make sense to check for the same payload keys as you did in the pretty test.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Test Results

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

Results for commit 2d7ee8e.

♻️ This comment has been updated with latest results.

@hanicz hanicz merged commit e52a169 into apache:master Apr 10, 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.

2 participants