Skip to content

Commit 5e3e62d

Browse files
committed
add basic cross-build test
1 parent c51d488 commit 5e3e62d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/test_examples.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,42 @@ def test_example_from_env_yaml(tmp_path, request):
741741
assert pkg["channel"] != "pypi"
742742

743743

744+
@pytest.fixture(params=["linux-aarch64"])
745+
def platform_conda_exe(request, tmp_path) -> Tuple[str, Path]:
746+
platform = request.param
747+
tmp_env = tmp_path / "env"
748+
subprocess.check_call(
749+
[
750+
sys.executable,
751+
"-mconda",
752+
"create",
753+
"-p",
754+
tmp_env,
755+
"-y",
756+
"conda-standalone",
757+
"--platform",
758+
platform,
759+
],
760+
)
761+
conda_exe = tmp_env / "conda_standalone/conda.exe"
762+
assert conda_exe.exists()
763+
return platform, tmp_env
764+
765+
766+
def test_cross_build_example_from_env_yaml(tmp_path, request, platform_conda_exe):
767+
platform, conda_exe = platform_conda_exe
768+
input_path = _example_path("from_env_yaml")
769+
770+
for installer, install_dir in create_installer(
771+
input_path,
772+
tmp_path,
773+
timeout=600,
774+
conda_exe=conda_exe,
775+
extra_constructor_args=["--platform", platform]
776+
):
777+
assert installer.exists()
778+
779+
744780
@pytest.mark.skipif(context.subdir != "linux-64", reason="Linux x64 only")
745781
def test_example_from_explicit(tmp_path, request):
746782
input_path = _example_path("from_explicit")

0 commit comments

Comments
 (0)