From 5547a10aba6e2677136307892f288bfee3e7c960 Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Wed, 27 Nov 2024 17:20:38 +0200 Subject: [PATCH] Revert "fix(ci): Use `juju wait-for` instead wait_for_idle() (#614)" This reverts commit ce22b7588916b23d36091b6e5dfa5e68009cdb08. --- requirements-integration-v1.in | 1 - requirements-integration-v1.txt | 2 -- tests/integration/test_kfp_functional_v1.py | 16 ++++++++++------ tests/integration/test_kfp_functional_v2.py | 16 +++++++++++----- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/requirements-integration-v1.in b/requirements-integration-v1.in index b4bd6e73..619721a9 100644 --- a/requirements-integration-v1.in +++ b/requirements-integration-v1.in @@ -11,4 +11,3 @@ pytest pytest-operator pyyaml tenacity -sh diff --git a/requirements-integration-v1.txt b/requirements-integration-v1.txt index 5ba4a321..25f9623b 100644 --- a/requirements-integration-v1.txt +++ b/requirements-integration-v1.txt @@ -272,8 +272,6 @@ 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 diff --git a/tests/integration/test_kfp_functional_v1.py b/tests/integration/test_kfp_functional_v1.py index ce09b7d8..3e7e394c 100644 --- a/tests/integration/test_kfp_functional_v1.py +++ b/tests/integration/test_kfp_functional_v1.py @@ -20,7 +20,6 @@ SAMPLE_VIEWER, ) -import sh import kfp import lightkube import pytest @@ -109,11 +108,16 @@ 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) - # Use `juju wait-for` instead of `wait_for_idle()` - # due to https://github.com/canonical/kfp-operators/issues/601 - # and https://github.com/juju/python-libjuju/issues/1204 - log.info("Waiting on model applications to be active") - sh.juju("wait-for","model","kubeflow", query="forEach(applications, app => app.status == 'active')", timeout="30m") + # 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, + ) # ---- KFP API Server focused test cases diff --git a/tests/integration/test_kfp_functional_v2.py b/tests/integration/test_kfp_functional_v2.py index 2e75f0cc..dd7a08e9 100644 --- a/tests/integration/test_kfp_functional_v2.py +++ b/tests/integration/test_kfp_functional_v2.py @@ -111,11 +111,17 @@ 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) - # Use `juju wait-for` instead of `wait_for_idle()` - # due to https://github.com/canonical/kfp-operators/issues/601 - # and https://github.com/juju/python-libjuju/issues/1204 - log.info("Waiting on model applications to be active") - sh.juju("wait-for","model","kubeflow", query="forEach(applications, app => app.status == 'active')", timeout="30m") + # 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, + ) + # ---- KFP API Server focused test cases async def test_upload_pipeline(kfp_client):