Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfail plugins tests when one fails #157

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
logger = logging.getLogger(__name__)


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("app_with_allowed_plugins")
async def test_plugins_remove_delay(
ops_test: OpsTest, update_status_env: typing.Iterable[str], unit_web_client: UnitWebClient
Expand Down Expand Up @@ -94,6 +95,7 @@ async def has_delay_log():
)


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("app_with_allowed_plugins")
async def test_jenkins_plugins_config(
ops_test: OpsTest,
Expand Down Expand Up @@ -127,6 +129,7 @@ async def test_jenkins_plugins_config(
assert all(unit_web_client.client.has_plugin(plugin) for plugin in ALLOWED_PLUGINS)


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("k8s_agent_related_app")
async def test_git_plugin_k8s_agent(unit_web_client: UnitWebClient):
"""
Expand All @@ -152,6 +155,7 @@ async def test_git_plugin_k8s_agent(unit_web_client: UnitWebClient):
) == "<div/>", f"Non-empty error message returned, {check_url_content}"


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("app_with_allowed_plugins")
async def test_ldap_plugin(
unit_web_client: UnitWebClient,
Expand Down Expand Up @@ -220,6 +224,7 @@ async def test_ldap_plugin(
), f"User lookup unsuccessful, {res.content}"


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("app_with_allowed_plugins")
async def test_matrix_combinations_parameter_plugin(unit_web_client: UnitWebClient):
"""
Expand Down Expand Up @@ -254,6 +259,7 @@ async def test_matrix_combinations_parameter_plugin(unit_web_client: UnitWebClie
), f"Configuration matrix table not found, {test_page}"


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("k8s_agent_related_app")
async def test_postbuildscript_plugin(
ops_test: OpsTest, unit_web_client: UnitWebClient, jenkins_k8s_agents: Application
Expand Down Expand Up @@ -288,6 +294,7 @@ async def test_postbuildscript_plugin(
assert stdout == test_output


@pytest.mark.abort_on_fail
async def test_ssh_agent_plugin(unit_web_client: UnitWebClient):
"""
arrange: given jenkins charm with ssh_agent plugin installed.
Expand All @@ -305,6 +312,7 @@ async def test_ssh_agent_plugin(unit_web_client: UnitWebClient):
assert "SSH Agent" in config_page, f"SSH agent configuration not found. {config_page}"


@pytest.mark.abort_on_fail
async def test_blueocean_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a jenkins charm with blueocean plugin installed.
Expand All @@ -322,6 +330,7 @@ async def test_blueocean_plugin(unit_web_client: UnitWebClient):
), f"Failed to access Blueocean frontend, {str(res.content, encoding='utf-8')}"


@pytest.mark.abort_on_fail
async def test_thinbackup_plugin(ops_test: OpsTest, unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with thinbackup plugin installed and backup configured.
Expand Down Expand Up @@ -374,6 +383,7 @@ async def has_backup() -> bool:
await wait_for(has_backup)


@pytest.mark.abort_on_fail
async def test_bzr_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with bazaar plugin installed.
Expand All @@ -391,6 +401,7 @@ async def test_bzr_plugin(unit_web_client: UnitWebClient):
assert "Bazaar" in config_page, f"Bzr configuration option not found. {config_page}"


@pytest.mark.abort_on_fail
async def test_docker_build_publish_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with docker-build-publish plugin installed.
Expand All @@ -408,6 +419,7 @@ async def test_docker_build_publish_plugin(unit_web_client: UnitWebClient):
), f"docker-build-publish configuration option not found. {config_page}"


@pytest.mark.abort_on_fail
async def test_reverse_proxy_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with reverse-proxy-auth-plugin plugin installed.
Expand All @@ -426,6 +438,7 @@ async def test_reverse_proxy_plugin(unit_web_client: UnitWebClient):
), f"reverse-proxy-auth-plugin configuration option not found. {config_page}"


@pytest.mark.abort_on_fail
async def test_dependency_check_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with dependency-check-jenkins-plugin plugin installed.
Expand All @@ -448,6 +461,7 @@ async def test_dependency_check_plugin(unit_web_client: UnitWebClient):
), f"Dependency check tool configuration option not found. {tools_page}"


@pytest.mark.abort_on_fail
async def test_groovy_libs_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with pipeline-groovy-lib plugin installed.
Expand All @@ -463,6 +477,7 @@ async def test_groovy_libs_plugin(unit_web_client: UnitWebClient):
), f"Groovy libs configuration option not found. {config_page}"


@pytest.mark.abort_on_fail
@pytest.mark.usefixtures("k8s_agent_related_app")
async def test_rebuilder_plugin(unit_web_client: UnitWebClient):
"""
Expand All @@ -484,6 +499,7 @@ async def test_rebuilder_plugin(unit_web_client: UnitWebClient):
assert job.get_last_buildnumber() == 2, "Rebuild not triggered."


@pytest.mark.abort_on_fail
async def test_openid_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with openid plugin installed.
Expand All @@ -501,6 +517,7 @@ async def test_openid_plugin(unit_web_client: UnitWebClient):
assert res.status_code == 200, "Failed to validate openid endpoint using the plugin."


@pytest.mark.abort_on_fail
async def test_openid_connect_plugin(
unit_web_client: UnitWebClient,
keycloak_oidc_meta: KeycloakOIDCMetadata,
Expand Down Expand Up @@ -572,6 +589,7 @@ async def test_openid_connect_plugin(
assert res.status_code == 200, "Failed to load Jenkins native login UI."


@pytest.mark.abort_on_fail
async def test_kubernetes_plugin(unit_web_client: UnitWebClient, kube_config: str):
"""
arrange: given a Jenkins charm with kubernetes plugin installed and credentials from microk8s.
Expand Down Expand Up @@ -599,6 +617,7 @@ async def test_kubernetes_plugin(unit_web_client: UnitWebClient, kube_config: st
assert build.get_status() == "SUCCESS"


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