Windows: port tests for mirror/blame (#45259)

This commit is contained in:
Nicole C. 2024-08-22 12:49:32 -04:00 committed by GitHub
parent f19b657235
commit 1bcb1fcebc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import pytest import pytest
from llnl.util.filesystem import working_dir from llnl.util.filesystem import working_dir
@ -33,11 +35,10 @@ def test_blame_by_percent(mock_packages):
assert "EMAIL" in out assert "EMAIL" in out
@pytest.mark.not_on_windows("Not supported on Windows (yet)")
def test_blame_file(mock_packages): def test_blame_file(mock_packages):
"""Sanity check the blame command to make sure it works.""" """Sanity check the blame command to make sure it works."""
with working_dir(spack.paths.prefix): with working_dir(spack.paths.prefix):
out = blame("bin/spack") out = blame(os.path.join("bin", "spack"))
assert "LAST_COMMIT" in out assert "LAST_COMMIT" in out
assert "AUTHOR" in out assert "AUTHOR" in out
assert "EMAIL" in out assert "EMAIL" in out

View File

@ -23,10 +23,7 @@
from spack.util.executable import which from spack.util.executable import which
from spack.util.spack_yaml import SpackYAMLError from spack.util.spack_yaml import SpackYAMLError
pytestmark = [ pytestmark = [pytest.mark.usefixtures("mutable_config", "mutable_mock_repo")]
pytest.mark.not_on_windows("does not run on windows"),
pytest.mark.usefixtures("mutable_config", "mutable_mock_repo"),
]
# paths in repos that shouldn't be in the mirror tarballs. # paths in repos that shouldn't be in the mirror tarballs.
exclude = [".hg", ".git", ".svn"] 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 """Confirm that the cosmetic symlink created in the mirror cache (which may
be relative) targets the storage path correctly. be relative) targets the storage path correctly.
""" """
cosmetic_path = "zlib/zlib-1.2.11.tar.gz" cosmetic_path = os.path.join("zlib", "zlib-1.2.11.tar.gz")
global_path = "_source-cache/archive/c3/c3e5.tar.gz" global_path = os.path.join("_source-cache", "archive", "c3", "c3e5.tar.gz")
cache = spack.caches.MirrorCache(str(tmpdir), False) cache = spack.caches.MirrorCache(str(tmpdir), False)
reference = spack.mirror.DefaultLayout(cosmetic_path, global_path) reference = spack.mirror.DefaultLayout(cosmetic_path, global_path)