Skip to content

Commit

Permalink
Windows: port tests for mirror/blame (spack#45259)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolecheetham authored Aug 22, 2024
1 parent f19b657 commit 1bcb1fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 3 additions & 2 deletions lib/spack/spack/test/cmd/blame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import os

import pytest

from llnl.util.filesystem import working_dir
Expand Down Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions lib/spack/spack/test/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
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"]
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 1bcb1fc

Please sign in to comment.