summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkus-ferrell <116021216+markus-ferrell@users.noreply.github.com>2023-01-20 20:54:06 -0500
committerGitHub <noreply@github.com>2023-01-20 17:54:06 -0800
commitc3e3c392a6154e826cbf5a9fc2b8f2f9c8daadb4 (patch)
tree790e6de0826472a186e06984aef7c122e4e24645
parenta424f7f173a85774f841ddf974b507c60521e127 (diff)
downloadspack-c3e3c392a6154e826cbf5a9fc2b8f2f9c8daadb4.tar.gz
spack-c3e3c392a6154e826cbf5a9fc2b8f2f9c8daadb4.tar.bz2
spack-c3e3c392a6154e826cbf5a9fc2b8f2f9c8daadb4.tar.xz
spack-c3e3c392a6154e826cbf5a9fc2b8f2f9c8daadb4.zip
Windows/testing: enable tests for "spack find" (#33588)
-rw-r--r--lib/spack/spack/test/cmd/find.py30
-rw-r--r--var/spack/repos/builtin.mock/packages/callpath/package.py5
-rw-r--r--var/spack/repos/builtin.mock/packages/dyninst/package.py5
3 files changed, 25 insertions, 15 deletions
diff --git a/lib/spack/spack/test/cmd/find.py b/lib/spack/spack/test/cmd/find.py
index 2406eeb62e..17153f998f 100644
--- a/lib/spack/spack/test/cmd/find.py
+++ b/lib/spack/spack/test/cmd/find.py
@@ -25,8 +25,6 @@ install = SpackCommand("install")
base32_alphabet = "abcdefghijklmnopqrstuvwxyz234567"
-pytestmark = pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
-
@pytest.fixture(scope="module")
def parser():
@@ -131,15 +129,28 @@ def test_namespaces_shown_correctly(database):
@pytest.mark.db
def test_find_cli_output_format(database, mock_tty_stdout):
+ # Currently logging on Windows detaches stdout
+ # from the terminal so we miss some output during tests
+ # TODO: (johnwparent): Once logging is amended on Windows,
+ # restore this test
out = find("zmpi")
- assert out.endswith(
- dedent(
- """\
- zmpi@1.0
- ==> 1 installed package
- """
+ if not sys.platform == "win32":
+ assert out.endswith(
+ dedent(
+ """\
+ zmpi@1.0
+ ==> 1 installed package
+ """
+ )
+ )
+ else:
+ assert out.endswith(
+ dedent(
+ """\
+ zmpi@1.0
+ """
+ )
)
- )
def _check_json_output(spec_list):
@@ -349,6 +360,7 @@ def test_find_command_basic_usage(database):
assert "mpileaks" in output
+@pytest.mark.skipif(sys.platform == "win32", reason="envirnment is not yet supported on windows")
@pytest.mark.regression("9875")
def test_find_prefix_in_env(
mutable_mock_env_path, install_mockery, mock_fetch, mock_packages, mock_archive, config
diff --git a/var/spack/repos/builtin.mock/packages/callpath/package.py b/var/spack/repos/builtin.mock/packages/callpath/package.py
index 9354fd1c1e..cc4e6fcb68 100644
--- a/var/spack/repos/builtin.mock/packages/callpath/package.py
+++ b/var/spack/repos/builtin.mock/packages/callpath/package.py
@@ -18,9 +18,8 @@ class Callpath(Package):
depends_on("mpi")
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix)
- make()
- make("install")
+ mkdirp(prefix)
+ touch(join_path(prefix, "dummyfile"))
def setup_run_environment(self, env):
env.set("FOOBAR", self.name)
diff --git a/var/spack/repos/builtin.mock/packages/dyninst/package.py b/var/spack/repos/builtin.mock/packages/dyninst/package.py
index 95011700e4..5309a0231a 100644
--- a/var/spack/repos/builtin.mock/packages/dyninst/package.py
+++ b/var/spack/repos/builtin.mock/packages/dyninst/package.py
@@ -30,6 +30,5 @@ class Dyninst(Package):
depends_on("libdwarf")
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix)
- make()
- make("install")
+ mkdirp(prefix)
+ touch(join_path(prefix, "dummyfile"))