Skip to content

Commit

Permalink
Merge branch 'main' into test-ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
arturo-seijas committed Feb 7, 2024
2 parents d92345c + 12083c8 commit 4583095
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def create_secret_file_credentials(
files = [("file0", ("config", kube_config_file, "application/octet-stream"))]
logger.debug("Creating jenkins credentials, params: %s %s %s", headers, files, payload)
res = unit_web_client.client.requester.post_url(
url=url, headers=headers, data=payload, files=files
url=url, headers=headers, data=payload, files=files, timeout=30
)
logger.debug("Credential created, %s", res.status_code)
return credentials_id if res.status_code == 200 else None
Expand Down Expand Up @@ -431,7 +431,9 @@ def create_kubernetes_cloud(
}

logger.debug("Creating jenkins kubernets cloud, params: %s %s", headers, payload)
res = unit_web_client.client.requester.post_url(url=url, headers=headers, data=payload)
res = unit_web_client.client.requester.post_url(
url=url, headers=headers, data=payload, timeout=30
)
logger.debug("Cloud created, %s", res.status_code)

return kubernetes_test_cloud_name if res.status_code == 200 else None
6 changes: 3 additions & 3 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
from .types_ import KeycloakOIDCMetadata, LDAPSettings, UnitWebClient

logger = logging.getLogger()
logger = logging.getLogger(__name__)


@pytest.mark.usefixtures("app_with_allowed_plugins")
Expand Down Expand Up @@ -561,8 +561,6 @@ async def test_kubernetes_plugin(unit_web_client: UnitWebClient, kube_config: st
"""
# Use plain credentials to be able to create secret-file/secret-text credentials
await install_plugins(unit_web_client, ("kubernetes", "plain-credentials"))

# Create credentials
credentials_id = create_secret_file_credentials(unit_web_client, kube_config)
assert credentials_id
kubernetes_cloud_name = create_kubernetes_cloud(unit_web_client, credentials_id)
Expand All @@ -571,8 +569,10 @@ async def test_kubernetes_plugin(unit_web_client: UnitWebClient, kube_config: st
"kubernetes_plugin_test",
gen_test_pipeline_with_custom_script_xml(kubernetes_test_pipeline_script()),
)

queue_item = job.invoke()
queue_item.block_until_complete()

build: jenkinsapi.build.Build = queue_item.get_build()
log_stream = build.stream_logs()
logs = "".join(log_stream)
Expand Down

0 comments on commit 4583095

Please sign in to comment.