Skip to content

Commit

Permalink
Testing fixes for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich committed Dec 2, 2023
1 parent 1785b27 commit ae5c769
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
2 changes: 0 additions & 2 deletions manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

import importlib.util
import os

import llnl.util.lang

import spack.util.spack_yaml as syaml

# from project import Project
from spack.util.path import canonicalize_path

DETECTION_SCRIPT = "find-{n}.py"
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

import pytest

import spack.extensions.manager as manager
from spack.test.conftest import * # noqa: F401 F403
import spack.extensions

spack.extensions.get_module("manager")

import spack.extensions.manager as manager # noqa E402
_test_root = os.path.dirname(__file__)


Expand Down
9 changes: 7 additions & 2 deletions tests/mock/project_a/find-project_a.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright (c) 2022, National Technology & Engineering Solutions of Sandia,
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

import os
import socket
import sys


class MachineData:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_create_dev_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

'''
import os
from unittest.mock import patch
Expand All @@ -13,7 +14,6 @@
# manager = spack.main.SpackCommand("manager")
'''
@patch("manager_cmds.create_dev_env.develop")
def test_allSpecsCallSpackDevelop(mock_dev, tmpdir):
with tmpdir.as_cwd():
Expand Down
6 changes: 2 additions & 4 deletions tests/test_create_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# for more details.

import os
from tempfile import TemporaryDirectory

import pytest

import spack.environment as env
Expand All @@ -31,8 +29,8 @@ def test_basicDirectoryProperties(tmpdir, on_moonlight):
assert yaml["spack"]["concretizer"]["unify"] is True


def test_failsWithAnUnregisteredMachine():
with TemporaryDirectory() as tmpdir:
def test_failsWithAnUnregisteredMachine(tmpdir):
with tmpdir.as_cwd():
with pytest.raises(Exception):
manager("create-env", "-d", tmpdir, "-m", "theGOAT_HPC")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

"""
import os
from unittest.mock import patch
Expand All @@ -16,7 +17,6 @@
env = spack.main.SpackCommand("env")
# manager = spack.main.SpackCommand("manager")
"""
@pytest.mark.usefixtures("mutable_mock_env_path", "mock_packages", "mock_fetch")
class TestSpackManagerDevelop(object):
@patch("manager_cmds.develop.spack_develop.develop")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

'''
import os
from unittest.mock import patch
Expand All @@ -25,7 +26,6 @@
env = spack.main.SpackCommand("env")
manager = spack.main.SpackCommand("manager")
'''
@pytest.mark.parametrize(
"spec_str",
[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

# from manager_cmds.pin import pin_graph

"""
from spack.spec import Spec
from spack.version import GitVersion
"""
# =============================================================================
# These tests are really slow because we have to concretize
# it would be good to come up with a quick concretization test suite
Expand Down

0 comments on commit ae5c769

Please sign in to comment.