Skip to content

Commit

Permalink
Fix workspace info tests
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasjacobsen committed Mar 7, 2024
1 parent 28f6ce0 commit 1fc88c4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
7 changes: 4 additions & 3 deletions lib/ramble/ramble/cmd/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,10 @@ def workspace_info(args):

for exp_name, _, _ in print_experiment_set.filtered_experiments(filters):
app_inst = experiment_set.get_experiment(exp_name)
software_environments.render_environment(
app_inst.expander.expand_var('{env_name}'), app_inst.expander
)
if app_inst.uses_spack:
software_environments.render_environment(
app_inst.expander.expand_var('{env_name}'), app_inst.expander
)

if print_header:
color.cprint(rucolor.nested_1(' Application: ') +
Expand Down
47 changes: 40 additions & 7 deletions lib/ramble/ramble/test/cmd/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,18 @@ def check_info_basic(output):
assert 'Workload' in output
assert 'Experiment' in output
assert 'Software Stack' in output
assert 'Packages' in output
assert 'Environments' in output


def check_info_zlib(output):
assert 'zlib' in output
assert 'ensure_installed' in output

assert 'Application' in output
assert 'Workload' in output
assert 'Experiment' in output
assert 'Software Stack' in output
assert 'Template Package' in output
assert 'Template Environment' in output


def check_results(ws):
Expand Down Expand Up @@ -178,11 +188,22 @@ def test_workspace_info():
test_experiment:
variables:
n_nodes: '2'
zlib:
workloads:
ensure_installed:
experiments:
test_experiment:
variables:
n_nodes: '2'
spack:
concretized: true
packages: {}
environments: {}
packages:
zlib:
spack_spec: 'zlib'
environments:
zlib:
packages:
- zlib
"""

workspace_name = 'test_info'
Expand Down Expand Up @@ -221,10 +242,22 @@ def test_workspace_info_prints_all_levels():
test_experiment:
variables:
n_nodes: '2'
zlib:
workloads:
ensure_installed:
experiments:
test_experiment:
variables:
n_nodes: '2'
spack:
concretized: true
packages: {}
environments: {}
packages:
zlib:
spack_spec: 'zlib'
environments:
zlib:
packages:
- zlib
"""

config_file = """
Expand Down

0 comments on commit 1fc88c4

Please sign in to comment.