summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormarkus-ferrell <116021216+markus-ferrell@users.noreply.github.com>2023-08-09 17:24:30 -0400
committerGitHub <noreply@github.com>2023-08-09 14:24:30 -0700
commit01b7cc51060a126ffbb8bec302736a6d46004fd9 (patch)
treea3fa128dcfdd52631015d42a276836de08dbc649 /lib
parentf5888d8127ed40909049627901b58d37626134a1 (diff)
downloadspack-01b7cc51060a126ffbb8bec302736a6d46004fd9.tar.gz
spack-01b7cc51060a126ffbb8bec302736a6d46004fd9.tar.bz2
spack-01b7cc51060a126ffbb8bec302736a6d46004fd9.tar.xz
spack-01b7cc51060a126ffbb8bec302736a6d46004fd9.zip
Windows: enable more stage tests (#36834)
Enable some already-supported tests (no changes to staging logic).
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/stage.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/spack/spack/test/stage.py b/lib/spack/spack/test/stage.py
index e507ac74e3..5e9e8ec855 100644
--- a/lib/spack/spack/test/stage.py
+++ b/lib/spack/spack/test/stage.py
@@ -659,7 +659,9 @@ class TestStage:
assert source_path.endswith(spack.stage._source_path_subdir)
assert not os.path.exists(source_path)
- @pytest.mark.skipif(sys.platform == "win32", reason="Not supported on Windows (yet)")
+ @pytest.mark.skipif(
+ sys.platform == "win32", reason="Windows file permission erroring is not yet supported"
+ )
@pytest.mark.skipif(getuid() == 0, reason="user is root")
def test_first_accessible_path(self, tmpdir):
"""Test _first_accessible_path names."""
@@ -691,7 +693,6 @@ class TestStage:
# Cleanup
shutil.rmtree(str(name))
- @pytest.mark.skipif(sys.platform == "win32", reason="Not supported on Windows (yet)")
def test_create_stage_root(self, tmpdir, no_path_access):
"""Test create_stage_root permissions."""
test_dir = tmpdir.join("path")
@@ -755,7 +756,9 @@ class TestStage:
assert spack.stage._resolve_paths(paths) == res_paths
- @pytest.mark.skipif(sys.platform == "win32", reason="Not supported on Windows (yet)")
+ @pytest.mark.skipif(
+ sys.platform == "win32", reason="Windows file permission erroring is not yet supported"
+ )
@pytest.mark.skipif(getuid() == 0, reason="user is root")
def test_get_stage_root_bad_path(self, clear_stage_root):
"""Ensure an invalid stage path root raises a StageError."""
@@ -864,7 +867,6 @@ class TestStage:
_file.read() == _readme_contents
-@pytest.mark.skipif(sys.platform == "win32", reason="Not supported on Windows (yet)")
def test_stage_create_replace_path(tmp_build_stage_dir):
"""Ensure stage creation replaces a non-directory path."""
_, test_stage_path = tmp_build_stage_dir
@@ -872,16 +874,15 @@ def test_stage_create_replace_path(tmp_build_stage_dir):
nondir = os.path.join(test_stage_path, "afile")
touch(nondir)
- path = str(nondir)
+ path = url_util.path_to_file_url(str(nondir))
- stage = Stage(path, name="")
+ stage = Stage(path, name="afile")
stage.create()
# Ensure the stage path is "converted" to a directory
- assert os.path.isdir(stage.path)
+ assert os.path.isdir(nondir)
-@pytest.mark.skipif(sys.platform == "win32", reason="Not supported on Windows (yet)")
def test_cannot_access(capsys):
"""Ensure can_access dies with the expected error."""
with pytest.raises(SystemExit):