Skip to content

Commit

Permalink
test: skip overlay tests if fuse-overlayfs not installed. (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Feb 2, 2024
1 parent 883083f commit 0705676
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"""Shared data for all craft-application tests."""
from __future__ import annotations

import os
import pathlib
import shutil
from importlib import metadata
from typing import TYPE_CHECKING, Any

Expand Down Expand Up @@ -113,6 +115,8 @@ def fake_build_plan() -> list[models.BuildInfo]:
@pytest.fixture()
def enable_overlay() -> Iterator[craft_parts.Features]:
"""Enable the overlay feature in craft_parts for the relevant test."""
if not os.getenv("CI") and not shutil.which("fuse-overlayfs"):
pytest.skip("fuse-overlayfs not installed, skipping overlay tests.")
craft_parts.Features.reset()
yield craft_parts.Features(enable_overlay=True)
craft_parts.Features.reset()
Expand Down

0 comments on commit 0705676

Please sign in to comment.