Skip to content

Commit

Permalink
further error resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalSiwek committed Dec 27, 2023
1 parent fc713f1 commit d3ea0b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ jobs:
if: failure()

- name: Get container
run: kubectl get pods -ntesting -lapp.kubernetes.io/name=zenml-server -oyaml
run: kubectl describe po -ntesting -lapp.kubernetes.io/name=zenml-server
if: failure()
22 changes: 3 additions & 19 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import subprocess
import time
from pathlib import Path

import pytest
Expand All @@ -21,13 +20,12 @@ async def test_successfull_deploy_senario(self, ops_test: OpsTest):
await ops_test.model.deploy(
RELATIONAL_DB_CHARM_NAME,
channel="8.0/stable",
series="jammy",
trust=True,
)
await ops_test.model.relate(CHARM_NAME, RELATIONAL_DB_CHARM_NAME)
await ops_test.model.relate(RELATIONAL_DB_CHARM_NAME, CHARM_NAME)

await ops_test.model.wait_for_idle(
apps=[CHARM_NAME],
apps=[CHARM_NAME, RELATIONAL_DB_CHARM_NAME],
status="active",
raise_on_blocked=False,
raise_on_error=False,
Expand All @@ -37,19 +35,7 @@ async def test_successfull_deploy_senario(self, ops_test: OpsTest):

config = await ops_test.model.applications[CHARM_NAME].get_config()

zenml_port = config["zenml_port"]["value"]

portforward_subprocess = subprocess.Popen(
[
"kubectl",
"-n",
f"{ops_test.model_name}",
"port-forward",
f"svc/{CHARM_NAME}",
f"{zenml_port}:{zenml_port}",
]
)
time.sleep(10) # Must wait for port-forward
zenml_port = config["zenml_nodeport"]["value"]

zenml_url = f"http://localhost:{zenml_port}"
zenml_subprocess = subprocess.run(
Expand All @@ -59,5 +45,3 @@ async def test_successfull_deploy_senario(self, ops_test: OpsTest):
if zenml_subprocess.stderr:
logger.info(f"ZenML command stderr: {zenml_subprocess.stderr}")
assert zenml_subprocess.returncode == 0

portforward_subprocess.terminate()

0 comments on commit d3ea0b0

Please sign in to comment.