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:
@@ -83,7 +83,6 @@ def test_checksum_args(arguments, expected):
|
|||||||
assert check == expected
|
assert check == expected
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_on_windows("Not supported on Windows (yet)")
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"arguments,expected",
|
"arguments,expected",
|
||||||
[
|
[
|
||||||
|
@@ -14,8 +14,6 @@
|
|||||||
deprecate = SpackCommand("deprecate")
|
deprecate = SpackCommand("deprecate")
|
||||||
find = SpackCommand("find")
|
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):
|
def test_deprecate(mock_packages, mock_archive, mock_fetch, install_mockery):
|
||||||
install("libelf@0.8.13")
|
install("libelf@0.8.13")
|
||||||
|
@@ -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"]
|
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):
|
def test_load_first(install_mockery, mock_fetch, mock_archive, mock_packages):
|
||||||
"""Test with and without the --first option"""
|
"""Test with and without the --first option"""
|
||||||
install_cmd("mpileaks")
|
install_cmd("mpileaks")
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@@ -16,10 +15,8 @@
|
|||||||
from spack.main import SpackCommand, SpackCommandError
|
from spack.main import SpackCommand, SpackCommandError
|
||||||
|
|
||||||
# Everything here uses (or can use) the mock config and database.
|
# Everything here uses (or can use) the mock config and database.
|
||||||
pytestmark = [
|
pytestmark = [pytest.mark.usefixtures("mutable_config", "mutable_database")]
|
||||||
pytest.mark.usefixtures("mutable_config", "mutable_database"),
|
|
||||||
pytest.mark.not_on_windows("does not run on windows"),
|
|
||||||
]
|
|
||||||
# location prints out "locations of packages and spack directories"
|
# location prints out "locations of packages and spack directories"
|
||||||
location = SpackCommand("location")
|
location = SpackCommand("location")
|
||||||
env = SpackCommand("env")
|
env = SpackCommand("env")
|
||||||
@@ -65,7 +62,7 @@ def test_location_source_dir_missing():
|
|||||||
prefix = "==> Error: "
|
prefix = "==> Error: "
|
||||||
expected = (
|
expected = (
|
||||||
"%sSource directory does not exist yet. Run this to create it:"
|
"%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()
|
out = location("--source-dir", spec, fail_on_error=False).strip()
|
||||||
assert out == expected
|
assert out == expected
|
||||||
|
@@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
providers = SpackCommand("providers")
|
providers = SpackCommand("providers")
|
||||||
|
|
||||||
pytestmark = pytest.mark.not_on_windows("Providers not currently supported on Windows")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"pkg",
|
"pkg",
|
||||||
|
@@ -4,8 +4,6 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
import spack.store
|
import spack.store
|
||||||
from spack.main import SpackCommand
|
from spack.main import SpackCommand
|
||||||
|
|
||||||
@@ -13,8 +11,6 @@
|
|||||||
deprecate = SpackCommand("deprecate")
|
deprecate = SpackCommand("deprecate")
|
||||||
reindex = SpackCommand("reindex")
|
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):
|
def test_reindex_basic(mock_packages, mock_archive, mock_fetch, install_mockery):
|
||||||
install("libelf@0.8.13")
|
install("libelf@0.8.13")
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
pytestmark = pytest.mark.usefixtures("install_mockery", "mock_packages")
|
pytestmark = pytest.mark.usefixtures("install_mockery", "mock_packages")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_on_windows("not implemented on windows")
|
|
||||||
@pytest.mark.disable_clean_stage_check
|
@pytest.mark.disable_clean_stage_check
|
||||||
def test_stage_spec(monkeypatch):
|
def test_stage_spec(monkeypatch):
|
||||||
"""Verify that staging specs works."""
|
"""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")
|
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
|
@pytest.mark.disable_clean_stage_check
|
||||||
def test_stage_with_env_outside_env(mutable_mock_env_path, monkeypatch):
|
def test_stage_with_env_outside_env(mutable_mock_env_path, monkeypatch):
|
||||||
"""Verify that stage concretizes specs not in environment instead of erroring."""
|
"""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")
|
stage("trivial-install-test-package")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_on_windows("not implemented on windows")
|
|
||||||
@pytest.mark.disable_clean_stage_check
|
@pytest.mark.disable_clean_stage_check
|
||||||
def test_stage_with_env_inside_env(mutable_mock_env_path, monkeypatch):
|
def test_stage_with_env_inside_env(mutable_mock_env_path, monkeypatch):
|
||||||
"""Verify that stage filters specs in environment instead of reconcretizing."""
|
"""Verify that stage filters specs in environment instead of reconcretizing."""
|
||||||
@@ -101,7 +98,6 @@ def fake_stage(pkg, mirror_only=False):
|
|||||||
stage("mpileaks")
|
stage("mpileaks")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_on_windows("not implemented on windows")
|
|
||||||
@pytest.mark.disable_clean_stage_check
|
@pytest.mark.disable_clean_stage_check
|
||||||
def test_stage_full_env(mutable_mock_env_path, monkeypatch):
|
def test_stage_full_env(mutable_mock_env_path, monkeypatch):
|
||||||
"""Verify that stage filters specs in environment."""
|
"""Verify that stage filters specs in environment."""
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -117,7 +116,6 @@ def test_url_summary(mock_packages):
|
|||||||
assert out_correct_versions == correct_versions
|
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):
|
def test_url_stats(capfd, mock_packages):
|
||||||
with capfd.disabled():
|
with capfd.disabled():
|
||||||
output = url("stats")
|
output = url("stats")
|
||||||
|
Reference in New Issue
Block a user