Skip to content

Commit

Permalink
update to latest workflow (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon authored May 8, 2024
1 parent ee5769a commit ca6edf8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
with:
channel: 1.28-strict/stable
extra-arguments: |
--kube-config ${GITHUB_WORKSPACE}/kube-config
--kube-config=${GITHUB_WORKSPACE}/kube-config
modules: '["test_auth_proxy.py", "test_cos.py", "test_ingress.py", "test_jenkins.py", "test_k8s_agent.py", "test_machine_agent.py", "test_plugins.py", "test_proxy.py", "test_upgrade.py", "test_external_agent.py"]'
pre-run-script: |
-c "sudo microk8s config > ${GITHUB_WORKSPACE}/kube-config
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def pytest_addoption(parser: pytest.Parser):
parser: pytest command line parser.
"""
# The prebuilt charm file.
parser.addoption("--charm-file", action="store", default="")
parser.addoption("--charm-file", action="append", default=[])
# The Jenkins image name:tag.
parser.addoption("--jenkins-image", action="store", default="")
# The path to kubernetes config.
Expand Down
13 changes: 7 additions & 6 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import random
import secrets
import string
from pathlib import Path
from typing import AsyncGenerator, Generator, Iterable, Optional

import jenkinsapi.jenkins
Expand Down Expand Up @@ -78,14 +79,14 @@ def num_units_fixture(request: FixtureRequest) -> int:


@pytest_asyncio.fixture(scope="module", name="charm")
async def charm_fixture(request: FixtureRequest, ops_test: OpsTest) -> str:
async def charm_fixture(request: FixtureRequest, ops_test: OpsTest) -> str | Path:
"""The path to charm."""
charm = request.config.getoption("--charm-file")
if not charm:
charms = request.config.getoption("--charm-file")
if not charms:
charm = await ops_test.build_charm(".")
else:
charm = f"./{charm}"
return charm
assert charm, "Charm not built"
return charm
return charms[0]


@pytest_asyncio.fixture(scope="module", name="application")
Expand Down

0 comments on commit ca6edf8

Please sign in to comment.