Skip to content

Commit

Permalink
tests: pin deployed charms to a CKF 1.8 compatible version
Browse files Browse the repository at this point in the history
This commit pins all charms that get deployed from Charmhub to a compatible version to the CKF 1.8 release.
This commit also refactors the test file so it takes all versions and other constants from a constants.py file

Part of canonical/bundle-kubeflow#863
  • Loading branch information
DnPlas committed Apr 15, 2024
1 parent 3ffb94b commit 7f8777d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
18 changes: 14 additions & 4 deletions tests/integration/test_charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
UI_APP_NAME = UI_METADATA["name"]
DB_APP_NAME = DB_METADATA["name"]

MYSQL_K8S = "mysql-k8s"
MYSQL_K8S_CHANNEL = "8.0/edge"
MYSQL_K8S_TRUST = True

KUBEFLOW_PROFILES = "kubeflow-profiles"
KUBEFLOW_PROFILES_CHANNEL = "latest/edge"
KUBEFLOW_PROFILES_TRUST = True

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -47,9 +55,11 @@ async def test_deploy_katib_charms(ops_test: OpsTest):

# Deploy katib-db
await ops_test.model.deploy(
"charmed-osm-mariadb-k8s",
MYSQL_K8S,
channel=MYSQL_K8S_CHANNEL,
application_name="katib-db",
config={"database": "katib"},
trust=MYSQL_K8S_TRUST,
)

# Relate to katib-db
Expand All @@ -63,9 +73,9 @@ async def test_deploy_katib_charms(ops_test: OpsTest):

# Deploy charms responsible for CRDs creation
await ops_test.model.deploy(
entity_url="kubeflow-profiles",
channel="latest/edge",
trust=True,
entity_url=KUBEFLOW_PROFILES,
channel=KUBEFLOW_PROFILES_CHANNEL,
trust=KUBEFLOW_PROFILES_TRUST,
)

# Wait for everything to deploy
Expand Down
12 changes: 7 additions & 5 deletions tests/integration/test_katib_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
kind="Profile",
plural="profiles",
)
TRAINING_CHARM = "training-operator"
TRAINING_OPERATOR = "training-operator"
TRAINING_OPERATOR_CHANNEL = "latest/edge"
TRAINING_OPERATOR_TRUST = True


@pytest.fixture(scope="module")
Expand All @@ -42,12 +44,12 @@ def lightkube_client() -> lightkube.Client:
async def training_operator(ops_test: OpsTest):
"""Deploy training-operator charm, and wait until it's active."""
await ops_test.model.deploy(
entity_url=TRAINING_CHARM,
channel="latest/edge",
trust=True,
entity_url=TRAINING_OPERATOR,
channel=TRAINING_OPERATOR_CHANNEL,
trust=TRAINING_OPERATOR_TRUST,
)
await ops_test.model.wait_for_idle(
apps=[TRAINING_CHARM], status="active", raise_on_blocked=False, timeout=60 * 5
apps=[TRAINING_OPERATOR], status="active", raise_on_blocked=False, timeout=60 * 5
)


Expand Down

0 comments on commit 7f8777d

Please sign in to comment.