Skip to content

Commit

Permalink
Add Docker plugin test (#97)
Browse files Browse the repository at this point in the history
* add docker plugin test

* address comments
  • Loading branch information
gtrkiller committed Jan 23, 2024
1 parent a3cb738 commit 0b47ddd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ options:
Comma-separated list of allowed plugin short names. If empty, any plugin can be installed.
Plugins installed by the user and their dependencies will be removed automatically if not on
the list. Included plugins are not automatically installed.
default: "bazaar,docker-build-publish,ldap,matrix-combinations-parameter,postbuildscript,ssh-agent,blueocean,thinBackup,rebuild,openid,oic-auth"
17 changes: 17 additions & 0 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,23 @@ async def test_bzr_plugin(unit_web_client: UnitWebClient):
assert "Bazaar" in config_page, f"Bzr configuration option not found. {config_page}"


async def test_docker_build_publish_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with docker-build-publish plugin installed.
act: when a job configuration page is accessed.
assert: docker-build-publish plugin option exists.
"""
await install_plugins(unit_web_client, ("docker-build-publish",))
unit_web_client.client.create_job("docker_plugin_test", gen_test_job_xml("k8s"))
res = unit_web_client.client.requester.get_url(
f"{unit_web_client.web}/job/docker_plugin_test/configure"
)
config_page = str(res.content, "utf-8")
assert (
"Docker Build and Publish" in config_page
), f"docker-build-publish configuration option not found. {config_page}"


@pytest.mark.usefixtures("k8s_agent_related_app")
async def test_rebuilder_plugin(unit_web_client: UnitWebClient):
"""
Expand Down

0 comments on commit 0b47ddd

Please sign in to comment.