Skip to content

Commit

Permalink
test: rebuild plugin (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Nov 11, 2023
1 parent 779bb02 commit ac6a9e5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,21 @@ async def test_thinbackup_plugin(ops_test: OpsTest, unit_web_client: UnitWebClie
)
assert ret == 0, f"Failed to ls backup path, {stderr}"
assert "FULL" in stdout, "The backup folder of format FULL-<backup-date> not found."


@pytest.mark.usefixtures("app_k8s_agent_related")
async def test_rebuilder_plugin(ops_test: OpsTest, unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with rebuilder plugin installed.
act: when a job is built and a rebuild is triggered.
assert: last job is rebuilt.
"""
await install_plugins(ops_test, unit_web_client.unit, unit_web_client.client, ("rebuild",))
job = unit_web_client.client.create_job("rebuild_test", gen_test_job_xml("k8s"))
job.invoke().block_until_complete()

unit_web_client.client.requester.get_url(
f"{unit_web_client.web}/job/rebuild_test/lastCompletedBuild/rebuild/"
)

assert job.get_last_buildnumber() == 2, "Rebuild not triggered."

0 comments on commit ac6a9e5

Please sign in to comment.