Skip to content

Commit

Permalink
Update external filtering based on exawind CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich committed Jul 16, 2024
1 parent c615178 commit 7c32d57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions manager/manager_cmds/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create_external_detected_spec(env, spec):
return spack.detection.DetectedPackage(Spec(pruned_spec), prefix)


def assemble_dict_of_detected_externals(env, black_list, white_list):
def assemble_dict_of_detected_externals(env, exclude, include):
external_spec_dict = {}
active_env = ev.active_environment()

Expand All @@ -70,11 +70,11 @@ def update_dictionary(env, spec):
for spec in env.all_specs():
if spec.external:
continue
if black_list:
if spec.name not in black_list:
if exclude:
if spec.name not in exclude:
update_dictionary(env, spec)
elif white_list:
if spec.name in white_list:
elif include:
if spec.name in include:
update_dictionary(env, spec)
else:
if not active_env.is_develop(spec):
Expand Down
4 changes: 3 additions & 1 deletion manager/manager_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def repl(match):

def pruned_spec_string(spec, variants_to_omit=["dev_path=", "patches=", "build_system="]):
full_spec = spec.format("{name}{@version}{%compiler}{variants}{arch=architecture}")
spec_components = full_spec.split(" ")

# add spaces between variants so we can filter
spec_components = full_spec.replace("+", " +").replace("~", " ~").split(" ")

def filter_func(entry):
for v in variants_to_omit:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ def impl_mock(*args):


@pytest.mark.skip()
def test_firstTimeAddingExternal(tmpdir):
def test_firstTimeAddingExternal(tmpdir, monkeypatch, arg_capture_patch, on_moonlight):
with tmpdir.as_cwd():
yaml_file = """spack:
view: true
specs: [mpileaks]"""
evaluate_external(tmpdir, yaml_file)
evaluate_external(tmpdir, yaml_file, monkeypatch, arg_capture_patch, on_moonlight)
assert os.path.isfile("test/externals.yaml")
with open("test/externals.yaml", "r") as f:
yaml = syaml.load(f)
Expand All @@ -188,7 +188,7 @@ def test_firstTimeAddingExternal(tmpdir):


@pytest.mark.skip()
def test_addToExistingExternal(tmpdir):
def test_addToExistingExternal(tmpdir, monkeypatch, arg_capture_patch, on_moonlight):
with tmpdir.as_cwd():
yaml_file = """spack:
view: true
Expand All @@ -202,7 +202,7 @@ def test_addToExistingExternal(tmpdir):
f.write("packages:\n")
f.write(str(ExtPackage("openmpi", "openmpi@4.0.3", "/path/to/other/view")))

evaluate_external(tmpdir, yaml_file)
evaluate_external(tmpdir, yaml_file, monkeypatch, arg_capture_patch, on_moonlight)

with open("test/externals.yaml", "r") as f:
yaml = syaml.load(f)
Expand Down

0 comments on commit 7c32d57

Please sign in to comment.