fix: increase SAML redirect timeout and add mock-saml health check
SAML e2e tests were timing out in CI waiting for the IdP redirect. Increase Playwright wait_for_url timeout from 10s to 30s and add a health check on the mock-saml service container so it's ready before tests start.
This commit is contained in:
parent
a012635dff
commit
edb25e83be
2 changed files with 7 additions and 2 deletions
|
|
@ -40,6 +40,11 @@ jobs:
|
||||||
SIMPLESAMLPHP_SP_ENTITY_ID: http://localhost:13003/auth/saml/test-saml/metadata
|
SIMPLESAMLPHP_SP_ENTITY_ID: http://localhost:13003/auth/saml/test-saml/metadata
|
||||||
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost:13003/auth/saml/test-saml/callback
|
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost:13003/auth/saml/test-saml/callback
|
||||||
SIMPLESAMLPHP_IDP_BASE_URL: http://mock-saml:8080/simplesaml/
|
SIMPLESAMLPHP_IDP_BASE_URL: http://mock-saml:8080/simplesaml/
|
||||||
|
options: >-
|
||||||
|
--health-cmd "curl -sf http://localhost:8080/simplesaml/ || wget -q -O /dev/null http://localhost:8080/simplesaml/ || exit 1"
|
||||||
|
--health-interval 5s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 10
|
||||||
env:
|
env:
|
||||||
CI: "true"
|
CI: "true"
|
||||||
WG_DATABASE_URL: postgresql+asyncpg://wiregui:wiregui@postgres/wiregui
|
WG_DATABASE_URL: postgresql+asyncpg://wiregui:wiregui@postgres/wiregui
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ async def test_saml_redirect_to_idp(app_with_saml, page: Page):
|
||||||
"""Clicking SAML login redirects to the SimpleSAMLphp IdP login page."""
|
"""Clicking SAML login redirects to the SimpleSAMLphp IdP login page."""
|
||||||
await page.goto(f"{SAML_APP_BASE}/auth/saml/test-saml")
|
await page.goto(f"{SAML_APP_BASE}/auth/saml/test-saml")
|
||||||
# Should redirect to the SimpleSAMLphp SSO service
|
# Should redirect to the SimpleSAMLphp SSO service
|
||||||
await page.wait_for_url(f"**{MOCK_SAML_HOST}:8080/simplesaml/**", timeout=10_000)
|
await page.wait_for_url(f"**{MOCK_SAML_HOST}:8080/simplesaml/**", timeout=30_000)
|
||||||
|
|
||||||
|
|
||||||
async def test_saml_sp_metadata_endpoint(app_with_saml, page: Page):
|
async def test_saml_sp_metadata_endpoint(app_with_saml, page: Page):
|
||||||
|
|
@ -155,7 +155,7 @@ async def test_saml_sp_metadata_endpoint(app_with_saml, page: Page):
|
||||||
async def test_full_saml_login_flow(app_with_saml, page: Page):
|
async def test_full_saml_login_flow(app_with_saml, page: Page):
|
||||||
"""Full SAML SSO flow: app → IdP login → callback → authenticated."""
|
"""Full SAML SSO flow: app → IdP login → callback → authenticated."""
|
||||||
await page.goto(f"{SAML_APP_BASE}/auth/saml/test-saml")
|
await page.goto(f"{SAML_APP_BASE}/auth/saml/test-saml")
|
||||||
await page.wait_for_url(f"**{MOCK_SAML_HOST}:8080/simplesaml/**", timeout=10_000)
|
await page.wait_for_url(f"**{MOCK_SAML_HOST}:8080/simplesaml/**", timeout=30_000)
|
||||||
|
|
||||||
# SimpleSAMLphp login form
|
# SimpleSAMLphp login form
|
||||||
await page.locator("input[name='username']").fill("user1")
|
await page.locator("input[name='username']").fill("user1")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue