Skip to content

Commit

Permalink
Use file resource argument provides by test caller
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Nov 20, 2024
1 parent b4c47fd commit ac5a691
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
log = logging.getLogger(__name__)
TEST_DATA = Path(__file__).parent / "data"
DEFAULT_SNAP_INSTALLATION = TEST_DATA / "default-snap-installation.tar.gz"
DEFAULT_RESOURCES = {"snap-installation": str(DEFAULT_SNAP_INSTALLATION.resolve())}
DEFAULT_RESOURCES = {"snap-installation": None}


def pytest_addoption(parser: pytest.Parser):
Expand All @@ -43,6 +43,9 @@ def pytest_addoption(parser: pytest.Parser):
parser: Pytest parser.
"""
parser.addoption("--charm-file", dest="charm_files", action="append", default=[])
parser.addoption(
"--snap-installation-resource", default=str(DEFAULT_SNAP_INSTALLATION.resolve())
)
parser.addoption("--cos", action="store_true", default=False, help="Run COS integration tests")
parser.addoption(
"--apply-proxy", action="store_true", default=False, help="Apply proxy to model-config"
Expand Down Expand Up @@ -427,6 +430,7 @@ async def kubernetes_cluster(request: pytest.FixtureRequest, ops_test: OpsTest):

charms = [Charm(ops_test, bundle.arch, Path("charms") / p) for p in ("worker/k8s", "worker")]
charm_files_args = request.config.option.charm_files
DEFAULT_RESOURCES["snap-installation"] = request.config.option.snap_installation_resource
charm_files = await asyncio.gather(*[charm.resolve(charm_files_args) for charm in charms])
switch_to_path = {}
for path, charm in zip(charm_files, charms):
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions trivy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
timeout: 20m
scan:
offline-scan: true
ignorePaths:
- snap-installation.tar.gz

0 comments on commit ac5a691

Please sign in to comment.