Skip to content

Commit

Permalink
Use sharded repodata in more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Nov 29, 2024
1 parent 4600200 commit cc826f2
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 310 deletions.
10 changes: 10 additions & 0 deletions tests/integration_python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ def pixi(request: pytest.FixtureRequest) -> Path:
return Path(__file__).parent.joinpath(f"../../target/pixi/{pixi_build}/pixi")


@pytest.fixture
def wrapped_tmp(tmp_path: Path) -> Path:
pixi_config = """
[repodata-config."https://prefix.dev/"]
disable-sharded = false
"""
tmp_path.joinpath("config.toml").write_text(pixi_config)
return tmp_path


@pytest.fixture
def channels() -> Path:
return Path(__file__).parent.parent.joinpath("data", "channels", "channels").resolve()
Expand Down
22 changes: 11 additions & 11 deletions tests/integration_python/pixi_build/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def examples_dir() -> Path:
return (Path(__file__).parent / "../../../examples").resolve()


def test_build_conda_package(pixi: Path, tmp_path: Path) -> None:
def test_build_conda_package(pixi: Path, wrapped_tmp: Path) -> None:
"""
This one tries to build the example flask hello world project
"""
pyproject = examples_dir() / "flask-hello-world-pyproject"
shutil.copytree(pyproject, tmp_path / "pyproject")
shutil.copytree(pyproject, wrapped_tmp / "pyproject")

manifest_path = tmp_path / "pyproject" / "pyproject.toml"
manifest_path = wrapped_tmp / "pyproject" / "pyproject.toml"
# Add a boltons package to it
verify_cli_command(
[
Expand All @@ -53,12 +53,12 @@ def test_build_conda_package(pixi: Path, tmp_path: Path) -> None:
assert package_to_be_built.exists()


def test_build_using_rattler_build_backend(pixi: Path, tmp_path: Path) -> None:
def test_build_using_rattler_build_backend(pixi: Path, wrapped_tmp: Path) -> None:
test_data = get_data_dir("rattler-build-backend")
shutil.copytree(test_data / "pixi", tmp_path / "pixi")
shutil.copyfile(test_data / "recipes/smokey/recipe.yaml", tmp_path / "pixi/recipe.yaml")
shutil.copytree(test_data / "pixi", wrapped_tmp / "pixi")
shutil.copyfile(test_data / "recipes/smokey/recipe.yaml", wrapped_tmp / "pixi/recipe.yaml")

manifest_path = tmp_path / "pixi" / "pixi.toml"
manifest_path = wrapped_tmp / "pixi" / "pixi.toml"

# Running pixi build should build the recipe.yaml
verify_cli_command(
Expand All @@ -72,11 +72,11 @@ def test_build_using_rattler_build_backend(pixi: Path, tmp_path: Path) -> None:
assert package_to_be_built.exists()


def test_smokey(pixi: Path, tmp_path: Path) -> None:
def test_smokey(pixi: Path, wrapped_tmp: Path) -> None:
test_data = get_data_dir("rattler-build-backend")
# copy the whole smokey project to the tmp_path
shutil.copytree(test_data, tmp_path / "test_data")
manifest_path = tmp_path / "test_data" / "smokey" / "pixi.toml"
# copy the whole smokey project to the wrapped_tmp
shutil.copytree(test_data, wrapped_tmp / "test_data")
manifest_path = wrapped_tmp / "test_data" / "smokey" / "pixi.toml"
verify_cli_command(
[
pixi,
Expand Down
Loading

0 comments on commit cc826f2

Please sign in to comment.