Skip to content

Commit

Permalink
skip: change all
Browse files Browse the repository at this point in the history
  • Loading branch information
DnPlas committed Dec 17, 2024
1 parent b8ba237 commit 17691dc
Show file tree
Hide file tree
Showing 18 changed files with 307 additions and 290 deletions.
2 changes: 1 addition & 1 deletion charms/kfp-api/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
def pytest_addoption(parser: Parser):
parser.addoption(
"--charm-path",
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml"
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml",
)
6 changes: 5 additions & 1 deletion charms/kfp-api/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ async def test_build_and_deploy(self, ops_test: OpsTest, request):
resources = {"oci-image": image_path}
# Keep the option to run the integration tests locally
# by building the charm and then deploying
entity_url = await ops_test.build_charm("./") if not (entity_url := request.config.getoption("--charm-path")) else entity_url
entity_url = (
await ops_test.build_charm("./")
if not (entity_url := request.config.getoption("--charm-path"))
else entity_url
)

await ops_test.model.deploy(
entity_url=entity_url,
Expand Down
2 changes: 1 addition & 1 deletion charms/kfp-metadata-writer/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
def pytest_addoption(parser: Parser):
parser.addoption(
"--charm-path",
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml"
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml",
)
34 changes: 13 additions & 21 deletions charms/kfp-metadata-writer/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,22 @@

@pytest.mark.abort_on_fail
async def test_build_and_deploy_with_relations(ops_test: OpsTest, request):
built_charm_path = await ops_test.build_charm(CHARM_ROOT)
log.info(f"Built charm {built_charm_path}")

image_path = METADATA["resources"]["oci-image"]["upstream-source"]
resources = {"oci-image": image_path}
# Keep the option to run the integration tests locally
# by building the charm and then deploying
entity_url = (
await ops_test.build_charm("./")
if not (entity_url := request.config.getoption("--charm-path"))
else entity_url
)

if entity_url := request.config.getoption("--charm-path"):
await ops_test.model.deploy(
entity_url=entity_url,
application_name=APP_NAME,
resources=resources,
trust=True,
)
else:
# Keep the option to run the integration tests locally
# by building the charm and then deploying
built_charm_path = await ops_test.build_charm("./")
logger.info(f"Built charm {built_charm_path}")
await ops_test.model.deploy(
entity_url=built_charm_path,
application_name=APP_NAME,
resources=resources,
trust=True,
)
await ops_test.model.deploy(
entity_url=entity_url,
application_name=APP_NAME,
resources=resources,
trust=True,
)

await ops_test.model.deploy(entity_url=MLMD, channel=MLMD_CHANNEL, trust=True)
await ops_test.model.integrate(f"{MLMD}:grpc", f"{APP_NAME}:grpc")
Expand Down
2 changes: 1 addition & 1 deletion charms/kfp-persistence/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
def pytest_addoption(parser: Parser):
parser.addoption(
"--charm-path",
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml"
help="Path to charm file when downloaded as artefact as a result of build_charm.yaml",
)
12 changes: 8 additions & 4 deletions charms/kfp-persistence/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ class TestCharm:
@pytest.mark.abort_on_fail
async def test_build_and_deploy(self, ops_test: OpsTest):
"""Deploy kfp-persistence with required charms and relations."""
built_charm_path = await ops_test.build_charm("./")
logger.info(f"Built charm {built_charm_path}")

image_path = METADATA["resources"]["oci-image"]["upstream-source"]
resources = {"oci-image": image_path}
# Keep the option to run the integration tests locally
# by building the charm and then deploying
entity_url = (
await ops_test.build_charm("./")
if not (entity_url := request.config.getoption("--charm-path"))
else entity_url
)

await ops_test.model.deploy(
entity_url=built_charm_path,
entity_url=entity_url,
application_name=APP_NAME,
resources=resources,
trust=True,
Expand Down
Loading

0 comments on commit 17691dc

Please sign in to comment.