Windows Tests: enable more cmd tests on Windows (#45031)

* Several tests can be enabled on Windows with no changes to logic
  (either the test logic or logic being tested)
* Test for `spack location` requires modification of the test logic,
  but with a minor change can be enabled on Windows
This commit is contained in:
Nicole C.
2024-07-19 21:08:28 -04:00
committed by GitHub
parent a6c638d0fa
commit 6810e9ed2e
8 changed files with 3 additions and 22 deletions

View File

@@ -83,7 +83,6 @@ def test_checksum_args(arguments, expected):
assert check == expected
@pytest.mark.not_on_windows("Not supported on Windows (yet)")
@pytest.mark.parametrize(
"arguments,expected",
[

View File

@@ -14,8 +14,6 @@
deprecate = SpackCommand("deprecate")
find = SpackCommand("find")
pytestmark = pytest.mark.not_on_windows("does not run on windows")
def test_deprecate(mock_packages, mock_archive, mock_fetch, install_mockery):
install("libelf@0.8.13")

View File

@@ -181,7 +181,6 @@ def test_diff_cmd(install_mockery, mock_fetch, mock_archive, mock_packages):
assert ["hash", "mpileaks %s" % specB.dag_hash()] in c["b_not_a"]
@pytest.mark.not_on_windows("Not supported on Windows (yet)")
def test_load_first(install_mockery, mock_fetch, mock_archive, mock_packages):
"""Test with and without the --first option"""
install_cmd("mpileaks")

View File

@@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import pytest
@@ -16,10 +15,8 @@
from spack.main import SpackCommand, SpackCommandError
# Everything here uses (or can use) the mock config and database.
pytestmark = [
pytest.mark.usefixtures("mutable_config", "mutable_database"),
pytest.mark.not_on_windows("does not run on windows"),
]
pytestmark = [pytest.mark.usefixtures("mutable_config", "mutable_database")]
# location prints out "locations of packages and spack directories"
location = SpackCommand("location")
env = SpackCommand("env")
@@ -65,7 +62,7 @@ def test_location_source_dir_missing():
prefix = "==> Error: "
expected = (
"%sSource directory does not exist yet. Run this to create it:"
"%s spack stage %s" % (prefix, os.linesep, spec)
"%s spack stage %s" % (prefix, "\n", spec)
)
out = location("--source-dir", spec, fail_on_error=False).strip()
assert out == expected

View File

@@ -10,8 +10,6 @@
providers = SpackCommand("providers")
pytestmark = pytest.mark.not_on_windows("Providers not currently supported on Windows")
@pytest.mark.parametrize(
"pkg",

View File

@@ -4,8 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import pytest
import spack.store
from spack.main import SpackCommand
@@ -13,8 +11,6 @@
deprecate = SpackCommand("deprecate")
reindex = SpackCommand("reindex")
pytestmark = pytest.mark.not_on_windows("does not run on windows")
def test_reindex_basic(mock_packages, mock_archive, mock_fetch, install_mockery):
install("libelf@0.8.13")

View File

@@ -22,7 +22,6 @@
pytestmark = pytest.mark.usefixtures("install_mockery", "mock_packages")
@pytest.mark.not_on_windows("not implemented on windows")
@pytest.mark.disable_clean_stage_check
def test_stage_spec(monkeypatch):
"""Verify that staging specs works."""
@@ -63,7 +62,6 @@ def test_stage_path_errors_multiple_specs(check_stage_path):
stage(f"--path={check_stage_path}", "trivial-install-test-package", "mpileaks")
@pytest.mark.not_on_windows("not implemented on windows")
@pytest.mark.disable_clean_stage_check
def test_stage_with_env_outside_env(mutable_mock_env_path, monkeypatch):
"""Verify that stage concretizes specs not in environment instead of erroring."""
@@ -82,7 +80,6 @@ def fake_stage(pkg, mirror_only=False):
stage("trivial-install-test-package")
@pytest.mark.not_on_windows("not implemented on windows")
@pytest.mark.disable_clean_stage_check
def test_stage_with_env_inside_env(mutable_mock_env_path, monkeypatch):
"""Verify that stage filters specs in environment instead of reconcretizing."""
@@ -101,7 +98,6 @@ def fake_stage(pkg, mirror_only=False):
stage("mpileaks")
@pytest.mark.not_on_windows("not implemented on windows")
@pytest.mark.disable_clean_stage_check
def test_stage_full_env(mutable_mock_env_path, monkeypatch):
"""Verify that stage filters specs in environment."""

View File

@@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import sys
import pytest
@@ -117,7 +116,6 @@ def test_url_summary(mock_packages):
assert out_correct_versions == correct_versions
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Unsupported on Windows for now")
def test_url_stats(capfd, mock_packages):
with capfd.disabled():
output = url("stats")