Skip to content

Commit

Permalink
feat: let pixi global sync collect errors rather than returning early
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Nov 28, 2024
1 parent 4e16fe0 commit 972ad56
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/integration_python/global/test_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,41 @@ def test_sync_duplicated_expose_error(pixi: Path, tmp_path: Path, dummy_channel_
)


def test_sync_failures_are_collected(pixi: Path, tmp_path: Path, dummy_channel_1: str) -> None:
env = {"PIXI_HOME": str(tmp_path)}
manifests = tmp_path.joinpath("manifests")
manifests.mkdir()
manifest = manifests.joinpath("pixi-global.toml")
toml = f"""
version = {MANIFEST_VERSION}
[envs.one]
channels = ["{dummy_channel_1}"]
dependencies = {{ invalid-package = "*" }}
exposed = {{ }}
[envs.two]
channels = ["{dummy_channel_1}"]
dependencies = {{ another-invalid-package = "*" }}
exposed = {{ }}
[envs.three]
channels = ["{dummy_channel_1}"]
dependencies = {{ dummy-a = "*" }}
exposed = {{ dummy-a = "dummy-a" }}
"""
manifest.write_text(toml)
dummy_a = tmp_path / "bin" / exec_extension("dummy-a")

verify_cli_command(
[pixi, "global", "sync"],
ExitCode.FAILURE,
env=env,
stderr_contains=["invalid-package", "another-invalid-package"],
)
assert dummy_a.is_file()


def test_expose_basic(pixi: Path, tmp_path: Path, dummy_channel_1: str) -> None:
env = {"PIXI_HOME": str(tmp_path)}
manifests = tmp_path.joinpath("manifests")
Expand Down

0 comments on commit 972ad56

Please sign in to comment.