Undo all unit-tests to see if CI will pass
This commit is contained in:
parent
4a8f755632
commit
3c6e6e22be
@ -3236,20 +3236,3 @@ def test_relative_view_path_on_command_line_is_made_absolute(tmpdir, config):
|
|||||||
env("create", "--with-view", "view", "--dir", "env")
|
env("create", "--with-view", "view", "--dir", "env")
|
||||||
environment = ev.Environment(os.path.join(".", "env"))
|
environment = ev.Environment(os.path.join(".", "env"))
|
||||||
assert os.path.samefile("view", environment.default_view.root)
|
assert os.path.samefile("view", environment.default_view.root)
|
||||||
|
|
||||||
|
|
||||||
def test_environment_created_in_users_location(mutable_config, tmpdir):
|
|
||||||
"""Test that an environment is created in a location based on the config"""
|
|
||||||
spack.config.set("config:environments_root", str(tmpdir.join("envs")))
|
|
||||||
env_dir = spack.config.get("config:environments_root")
|
|
||||||
|
|
||||||
assert tmpdir.strpath in env_dir
|
|
||||||
assert not os.path.isdir(env_dir)
|
|
||||||
|
|
||||||
dir_name = "user_env"
|
|
||||||
env("create", dir_name)
|
|
||||||
out = env("list")
|
|
||||||
|
|
||||||
assert dir_name in out
|
|
||||||
assert env_dir in ev.root(dir_name)
|
|
||||||
assert os.path.isdir(os.path.join(env_dir, dir_name))
|
|
||||||
|
@ -37,7 +37,7 @@ def test_regression_8083(tmpdir, capfd, mock_packages, mock_fetch, config):
|
|||||||
|
|
||||||
@pytest.mark.regression("12345")
|
@pytest.mark.regression("12345")
|
||||||
def test_mirror_from_env(tmpdir, mock_packages, mock_fetch, config, mutable_mock_env_path):
|
def test_mirror_from_env(tmpdir, mock_packages, mock_fetch, config, mutable_mock_env_path):
|
||||||
mirror_dir = str(tmpdir.join("mirror_dir"))
|
mirror_dir = str(tmpdir)
|
||||||
env_name = "test"
|
env_name = "test"
|
||||||
|
|
||||||
env("create", env_name)
|
env("create", env_name)
|
||||||
|
@ -225,17 +225,8 @@ class TestUninstallFromEnv(object):
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def environment_setup(
|
def environment_setup(
|
||||||
self,
|
self, mutable_mock_env_path, config, mock_packages, mutable_database, install_mockery
|
||||||
mutable_mock_env_path,
|
|
||||||
config,
|
|
||||||
mock_packages,
|
|
||||||
mutable_database,
|
|
||||||
install_mockery,
|
|
||||||
tmpdir,
|
|
||||||
):
|
):
|
||||||
# make environments local to each instantiation of the fixture so they don't clash
|
|
||||||
# in parallel
|
|
||||||
spack.config.set("config:environments_root", str(tmpdir.join("envs")))
|
|
||||||
TestUninstallFromEnv.env("create", "e1")
|
TestUninstallFromEnv.env("create", "e1")
|
||||||
e1 = spack.environment.read("e1")
|
e1 = spack.environment.read("e1")
|
||||||
with e1:
|
with e1:
|
||||||
|
@ -1027,7 +1027,6 @@ def test_good_env_yaml(tmpdir):
|
|||||||
config:
|
config:
|
||||||
verify_ssl: False
|
verify_ssl: False
|
||||||
dirty: False
|
dirty: False
|
||||||
environments_root: ~/my/env/location
|
|
||||||
repos:
|
repos:
|
||||||
- ~/my/repo/location
|
- ~/my/repo/location
|
||||||
mirrors:
|
mirrors:
|
||||||
@ -1455,7 +1454,7 @@ def test_config_file_read_perms_failure(tmpdir, mutable_empty_config):
|
|||||||
def test_config_file_read_invalid_yaml(tmpdir, mutable_empty_config):
|
def test_config_file_read_invalid_yaml(tmpdir, mutable_empty_config):
|
||||||
"""Test reading a configuration file with invalid (unparseable) YAML
|
"""Test reading a configuration file with invalid (unparseable) YAML
|
||||||
raises a ConfigFileError."""
|
raises a ConfigFileError."""
|
||||||
filename = tmpdir.join("test.yaml")
|
filename = join_path(tmpdir.strpath, "test.yaml")
|
||||||
with open(filename, "w") as f:
|
with open(filename, "w") as f:
|
||||||
f.write("spack:\nview")
|
f.write("spack:\nview")
|
||||||
|
|
||||||
|
@ -1551,14 +1551,14 @@ def get_rev():
|
|||||||
yield t
|
yield t
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture()
|
||||||
def mutable_mock_env_path(tmpdir, mutable_config):
|
def mutable_mock_env_path(tmpdir_factory):
|
||||||
"""Fixture for mocking the internal spack environments directory."""
|
"""Fixture for mocking the internal spack environments directory."""
|
||||||
saved_path = ev.environment.default_env_path
|
saved_path = ev.environment.env_path
|
||||||
mock_path = tmpdir.join("mock-env-path")
|
mock_path = tmpdir_factory.mktemp("mock-env-path")
|
||||||
ev.environment.default_env_path = str(mock_path)
|
ev.environment.env_path = str(mock_path)
|
||||||
yield mock_path
|
yield mock_path
|
||||||
ev.environment.default_env_path = saved_path
|
ev.environment.env_path = saved_path
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
|
@ -108,24 +108,6 @@ def test_env_change_spec_in_matrix_raises_error(
|
|||||||
assert "Cannot directly change specs in matrices" in str(error)
|
assert "Cannot directly change specs in matrices" in str(error)
|
||||||
|
|
||||||
|
|
||||||
def test_environment_cant_modify_environments_root(tmpdir):
|
|
||||||
filename = str(tmpdir.join("spack.yaml"))
|
|
||||||
with open(filename, "w") as f:
|
|
||||||
f.write(
|
|
||||||
"""\
|
|
||||||
spack:
|
|
||||||
config:
|
|
||||||
environments_root: /a/black/hole
|
|
||||||
view: false
|
|
||||||
specs: []
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
with tmpdir.as_cwd():
|
|
||||||
with pytest.raises(ev.SpackEnvironmentError):
|
|
||||||
e = ev.Environment(tmpdir.strpath)
|
|
||||||
ev.activate(e)
|
|
||||||
|
|
||||||
|
|
||||||
def test_activate_should_require_an_env():
|
def test_activate_should_require_an_env():
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
ev.activate(env="name")
|
ev.activate(env="name")
|
||||||
|
@ -38,12 +38,7 @@ def check_blame(element, file_name, line=None):
|
|||||||
if line is not None:
|
if line is not None:
|
||||||
annotation += ":%d" % line
|
annotation += ":%d" % line
|
||||||
|
|
||||||
try:
|
assert file_name in element_line
|
||||||
assert file_name in element_line
|
|
||||||
except Exception:
|
|
||||||
print(output)
|
|
||||||
finally:
|
|
||||||
assert file_name in element_line
|
|
||||||
|
|
||||||
|
|
||||||
def test_config_blame(config):
|
def test_config_blame(config):
|
||||||
|
Loading…
Reference in New Issue
Block a user