Skip to content

Commit

Permalink
fix(ci): Use juju wait-for instead wait_for_idle()
Browse files Browse the repository at this point in the history
  • Loading branch information
orfeas-k committed Nov 21, 2024
1 parent 1f872e0 commit 1065917
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
1 change: 1 addition & 0 deletions requirements-integration-v1.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pytest
pytest-operator
pyyaml
tenacity
sh
2 changes: 2 additions & 0 deletions requirements-integration-v1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ rich==13.7.1
# via typer
rsa==4.9
# via google-auth
sh==2.1.0
# via -r requirements-integration-v1.in
shellingham==1.5.4
# via typer
six==1.16.0
Expand Down
15 changes: 5 additions & 10 deletions tests/integration/test_kfp_functional_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SAMPLE_VIEWER,
)

import sh
import kfp
import lightkube
import pytest
Expand Down Expand Up @@ -101,16 +102,10 @@ async def test_build_and_deploy(ops_test: OpsTest, request, lightkube_client):
# Deploy the kfp-operators bundle from the rendered bundle file
await deploy_bundle(ops_test, bundle_path=rendered_bundle, trust=True)

# Wait for everything to be up. Note, at time of writing these charms would naturally go
# into blocked during deploy while waiting for each other to satisfy relations, so we don't
# raise_on_blocked.
await ops_test.model.wait_for_idle(
status="active",
raise_on_blocked=False, # These apps block while waiting for each other to deploy/relate
raise_on_error=True,
timeout=3600,
idle_period=30,
)
# Use `juju wait-for` instead of `wait_for_idle()`
# due to https://github.com/canonical/kfp-operators/issues/601
log.info("Waiting on model applications to be active")
sh.juju("wait-for","model","kubeflow", query="forEach(applications, app => app.status == 'active')", timeout="30m")


# ---- KFP API Server focused test cases
Expand Down
15 changes: 4 additions & 11 deletions tests/integration/test_kfp_functional_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,10 @@ async def test_build_and_deploy(ops_test: OpsTest, request, lightkube_client):
# Deploy the kfp-operators bundle from the rendered bundle file
await deploy_bundle(ops_test, bundle_path=rendered_bundle, trust=True)

# Wait for everything to be up. Note, at time of writing these charms would naturally go
# into blocked during deploy while waiting for each other to satisfy relations, so we don't
# raise_on_blocked.
await ops_test.model.wait_for_idle(
status="active",
raise_on_blocked=False, # These apps block while waiting for each other to deploy/relate
raise_on_error=True,
timeout=3600,
idle_period=30,
)

# Use `juju wait-for` instead of `wait_for_idle()`
# due to https://github.com/canonical/kfp-operators/issues/601
log.info("Waiting on model applications to be active")
sh.juju("wait-for","model","kubeflow", query="forEach(applications, app => app.status == 'active')", timeout="30m")

# ---- KFP API Server focused test cases
async def test_upload_pipeline(kfp_client):
Expand Down

0 comments on commit 1065917

Please sign in to comment.