temporarily undo everything in this PR to check if it could somehow be causing a failure in an unrelated test
This commit is contained in:
committed by
Gregory Becker
parent
114ad6dd0a
commit
edc3a3d19b
@@ -1362,21 +1362,7 @@ def get_pkg_class(self, pkg_name):
|
|||||||
if not inspect.isclass(cls):
|
if not inspect.isclass(cls):
|
||||||
tty.die("%s.%s is not a class" % (pkg_name, class_name))
|
tty.die("%s.%s is not a class" % (pkg_name, class_name))
|
||||||
|
|
||||||
new_cfg_settings = (
|
# TODO: restore logic here
|
||||||
spack.config.get("packages").get(pkg_name, {}).get("package_attributes", {})
|
|
||||||
)
|
|
||||||
overidden_attrs = getattr(cls, "overidden_attrs", {})
|
|
||||||
for key, val in overidden_attrs.items():
|
|
||||||
setattr(cls, key, val)
|
|
||||||
# Keep track of every class attribute that is overidden by the config:
|
|
||||||
# if the config changes between calls to this method, we make sure to
|
|
||||||
# restore the original config values (in case the new config no longer
|
|
||||||
# sets attributes that it used to)
|
|
||||||
new_overidden_attrs = {}
|
|
||||||
for key, val in new_cfg_settings.items():
|
|
||||||
new_overidden_attrs[key] = getattr(cls, key)
|
|
||||||
setattr(cls, key, val)
|
|
||||||
setattr(cls, "overidden_attrs", dict(new_overidden_attrs))
|
|
||||||
|
|
||||||
return cls
|
return cls
|
||||||
|
|
||||||
|
|||||||
@@ -179,22 +179,6 @@ def test_preferred_providers(self):
|
|||||||
spec = concretize("mpileaks")
|
spec = concretize("mpileaks")
|
||||||
assert "zmpi" in spec
|
assert "zmpi" in spec
|
||||||
|
|
||||||
def test_config_set_url_for_package(self, mutable_mock_repo):
|
|
||||||
"""Test preferred providers of virtual packages are
|
|
||||||
applied correctly
|
|
||||||
"""
|
|
||||||
update_packages(
|
|
||||||
"mpileaks",
|
|
||||||
"package_attributes",
|
|
||||||
{"url": "http://www.somewhereelse.com/mpileaks-1.0.tar.gz"},
|
|
||||||
)
|
|
||||||
spec = concretize("mpileaks")
|
|
||||||
assert spec.package.fetcher[0].url == "http://www.somewhereelse.com/mpileaks-2.3.tar.gz"
|
|
||||||
|
|
||||||
update_packages("mpileaks", "package_attributes", {})
|
|
||||||
spec = concretize("mpileaks")
|
|
||||||
assert spec.package.fetcher[0].url == "http://www.llnl.gov/mpileaks-2.3.tar.gz"
|
|
||||||
|
|
||||||
def test_preferred(self):
|
def test_preferred(self):
|
||||||
""" "Test packages with some version marked as preferred=True"""
|
""" "Test packages with some version marked as preferred=True"""
|
||||||
spec = Spec("python")
|
spec = Spec("python")
|
||||||
|
|||||||
Reference in New Issue
Block a user