Skip to content

Commit

Permalink
Merge pull request #660 from linsword13/default-shell
Browse files Browse the repository at this point in the history
Change default shell to bash
  • Loading branch information
douglasjacobsen authored Sep 25, 2024
2 parents ffd1122 + bc75671 commit 49857c1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/ramble/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ config:
verify_ssl: true
connect_timeout: 10
checksum: true
shell: sh
shell: bash
input_cache: $ramble/var/ramble/cache
workspace_dirs: $ramble/var/ramble/workspaces
include_phase_dependencies: false
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"build_stage": "$tempdir/ramble-stage",
"concretizer": "clingo",
"license_dir": spack.paths.default_license_dir,
"shell": "sh",
"shell": "bash",
"spack": {"flags": {"install": "--reuse", "concretize": "--reuse"}},
"pip": {"install": {"flags": []}},
"input_cache": "$ramble/var/ramble/cache",
Expand Down
34 changes: 34 additions & 0 deletions lib/ramble/ramble/test/config_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

import ramble.config


# A crude assertion to check there's no conflicting value.
# It supports only list and dict as containers, instead of
# the more general abstract types.
def _assert_no_conflict_recurse(a, b):
if a is None or b is None:
return
if isinstance(a, dict):
for k, v in a.items():
_assert_no_conflict_recurse(v, b.get(k))
elif isinstance(a, list):
for i, v in enumerate(a):
_assert_no_conflict_recurse(v, b[i])
else:
assert a == b


def test_default_configs_no_conflict(default_config):
"""Ensure the hard-coded config_defaults do not conflict with etc/defaults/config.yaml"""
defaults_in_mem = ramble.config.config_defaults["config"]
assert defaults_in_mem
for k, v in defaults_in_mem.items():
in_file_def = ramble.config.get(f"config:{k}")
_assert_no_conflict_recurse(v, in_file_def)
2 changes: 1 addition & 1 deletion lib/ramble/ramble/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def mutable_mock_pkg_mans_repo(mock_mods_repo_path):
yield mock_repo_path


@pytest.fixture(scope="session")
@pytest.fixture(scope="function")
def default_config():
"""Isolates the default configuration from the user configs.
Expand Down

0 comments on commit 49857c1

Please sign in to comment.