From 727a91af6ba78d1300572f1223112fc91cd46b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Mathurin?= Date: Mon, 22 Sep 2025 14:56:35 +0200 Subject: [PATCH 1/3] Fix URL accessed in test_auth0_oauth_via_proxy --- panel/tests/ui/test_auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/tests/ui/test_auth.py b/panel/tests/ui/test_auth.py index 41e02e7ce1..1546978a55 100644 --- a/panel/tests/ui/test_auth.py +++ b/panel/tests/ui/test_auth.py @@ -196,8 +196,8 @@ def test_auth0_oauth_via_proxy(py_file, page): py_file.name ] with run_panel_serve(cmd) as p: - port = wait_for_port(p.stdout) - page.goto(f"http://localhost:{port}") + wait_for_port(p.stdout) + page.goto(f"http://localhost:{proxy}/proxy/{app_name}") page.locator('input[name="username"]').fill(auth0_user) page.locator('input[name="password"]').fill(auth0_password) From 1fd38d9f8416ad2bb2d667f989272b0af8ceec51 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 22 Sep 2025 15:05:59 +0200 Subject: [PATCH 2/3] Apply suggestions from code review --- panel/tests/ui/test_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/tests/ui/test_auth.py b/panel/tests/ui/test_auth.py index 1546978a55..27f64682dc 100644 --- a/panel/tests/ui/test_auth.py +++ b/panel/tests/ui/test_auth.py @@ -197,7 +197,7 @@ def test_auth0_oauth_via_proxy(py_file, page): ] with run_panel_serve(cmd) as p: wait_for_port(p.stdout) - page.goto(f"http://localhost:{proxy}/proxy/{app_name}") + page.goto(f"http://localhost:{proxy}/proxy/") page.locator('input[name="username"]').fill(auth0_user) page.locator('input[name="password"]').fill(auth0_password) From 1c6a884d779054f0e9e2e284639147e636b2a5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Mathurin?= Date: Mon, 22 Sep 2025 15:08:48 +0200 Subject: [PATCH 3/3] Fix undefined app_name --- panel/tests/ui/test_auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panel/tests/ui/test_auth.py b/panel/tests/ui/test_auth.py index 27f64682dc..108c9eb2de 100644 --- a/panel/tests/ui/test_auth.py +++ b/panel/tests/ui/test_auth.py @@ -178,6 +178,8 @@ def test_auth0_oauth_via_proxy(py_file, page): app = "import panel as pn; pn.pane.Markdown(pn.state.user).servable(title='A')" write_file(app, py_file.file) + app_name = os.path.basename(py_file.name)[:-3] + proxy = os.environ.get('AUTH0_PORT', '5701') cookie_secret = os.environ['OAUTH_COOKIE_SECRET'] encryption_key = os.environ['OAUTH_ENCRYPTION_KEY'] @@ -197,7 +199,7 @@ def test_auth0_oauth_via_proxy(py_file, page): ] with run_panel_serve(cmd) as p: wait_for_port(p.stdout) - page.goto(f"http://localhost:{proxy}/proxy/") + page.goto(f"http://localhost:{proxy}/proxy/{app_name}") page.locator('input[name="username"]').fill(auth0_user) page.locator('input[name="password"]').fill(auth0_password)