From 049515f69b5bdf08469c1a7773efa35e7693db2a Mon Sep 17 00:00:00 2001 From: Yanks Yoon <37652070+yanksyoon@users.noreply.github.com> Date: Thu, 2 Nov 2023 21:50:33 +0800 Subject: [PATCH] test: blueocean plugin (#47) --- tests/integration/test_plugins.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration/test_plugins.py b/tests/integration/test_plugins.py index f9c9ca1e..3b229b63 100644 --- a/tests/integration/test_plugins.py +++ b/tests/integration/test_plugins.py @@ -219,3 +219,20 @@ async def test_postbuildscript_plugin( ) assert ret == 0, f"Failed to scp test output file, {stderr}" assert stdout == test_output + + +async def test_blueocean_plugin(ops_test: OpsTest, unit_web_client: UnitWebClient): + """ + arrange: given a jenkins charm with blueocean plugin installed. + act: when blueocean frontend url is accessed. + assert: 200 response is returned. + """ + await install_plugins(ops_test, unit_web_client.unit, unit_web_client.client, ("blueocean",)) + + res = unit_web_client.client.requester.get_url( + f"{unit_web_client.web}/blue/organizations/jenkins/" + ) + + assert ( + res.status_code == 200 + ), f"Failed to access Blueocean frontend, {str(res.content, encoding='utf-8')}"