Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update external filtering based on exawind CI failure #611

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", "[email protected]", "/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
Loading