From 1bcb1fcebc42d9de78e48a950950d08d75bb2646 Mon Sep 17 00:00:00 2001 From: "Nicole C." <48625123+nicolecheetham@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:49:32 -0400 Subject: Windows: port tests for mirror/blame (#45259) --- lib/spack/spack/test/cmd/blame.py | 5 +++-- lib/spack/spack/test/mirror.py | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/spack/spack/test/cmd/blame.py b/lib/spack/spack/test/cmd/blame.py index f9484e2dce..dcc26c9153 100644 --- a/lib/spack/spack/test/cmd/blame.py +++ b/lib/spack/spack/test/cmd/blame.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + import pytest from llnl.util.filesystem import working_dir @@ -33,11 +35,10 @@ def test_blame_by_percent(mock_packages): assert "EMAIL" in out -@pytest.mark.not_on_windows("Not supported on Windows (yet)") def test_blame_file(mock_packages): """Sanity check the blame command to make sure it works.""" with working_dir(spack.paths.prefix): - out = blame("bin/spack") + out = blame(os.path.join("bin", "spack")) assert "LAST_COMMIT" in out assert "AUTHOR" in out assert "EMAIL" in out diff --git a/lib/spack/spack/test/mirror.py b/lib/spack/spack/test/mirror.py index 5cb9282225..2c389538ef 100644 --- a/lib/spack/spack/test/mirror.py +++ b/lib/spack/spack/test/mirror.py @@ -23,10 +23,7 @@ from spack.stage import Stage from spack.util.executable import which from spack.util.spack_yaml import SpackYAMLError -pytestmark = [ - pytest.mark.not_on_windows("does not run on windows"), - pytest.mark.usefixtures("mutable_config", "mutable_mock_repo"), -] +pytestmark = [pytest.mark.usefixtures("mutable_config", "mutable_mock_repo")] # paths in repos that shouldn't be in the mirror tarballs. exclude = [".hg", ".git", ".svn"] @@ -273,8 +270,8 @@ def test_mirror_cache_symlinks(tmpdir): """Confirm that the cosmetic symlink created in the mirror cache (which may be relative) targets the storage path correctly. """ - cosmetic_path = "zlib/zlib-1.2.11.tar.gz" - global_path = "_source-cache/archive/c3/c3e5.tar.gz" + cosmetic_path = os.path.join("zlib", "zlib-1.2.11.tar.gz") + global_path = os.path.join("_source-cache", "archive", "c3", "c3e5.tar.gz") cache = spack.caches.MirrorCache(str(tmpdir), False) reference = spack.mirror.DefaultLayout(cosmetic_path, global_path) -- cgit v1.2.3-70-g09d2