Skip to content
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
3 changes: 2 additions & 1 deletion cfbs/cfbs_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def add_with_dependencies(
name = module["name"]
assert "steps" in module
if self._module_is_in_build(module):
print("Skipping already added module '%s'" % name)
if is_module_added_manually(str_added_by):
print("Skipping already added module '%s'" % name)
return
if "dependencies" in module:
for dep in module["dependencies"]:
Expand Down
21 changes: 21 additions & 0 deletions tests/shell/041_add_multidep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set -e
set -x
cd tests/
mkdir -p ./tmp/
cd ./tmp/
touch cfbs.json && rm cfbs.json
rm -rf .git

cfbs --non-interactive init

cfbs --non-interactive add https://github.com/cfengine/test-cfbs-static-repo > output.log 2>&1

# All four modules were correctly added
grep -F "Added module: test-library-parsed-local-users" ./output.log
grep -F "Added module: test-library-parsed-etc-group" ./output.log
grep -F "Added module: test-inventory-local-groups" ./output.log
grep -F "Added module: test-inventory-local-users" ./output.log

# Adding modules together with their dependencies should not display skipping messages (CFE-3841):
! ( grep -F "Skipping already added" ./output.log )

1 change: 1 addition & 0 deletions tests/shell/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ bash tests/shell/037_cfbs_validate.sh
bash tests/shell/038_global_dir.sh
bash tests/shell/039_add_added_by_field_update_1.sh
bash tests/shell/040_add_added_by_field_update_2.sh
bash tests/shell/041_add_multidep.sh

echo "All cfbs shell tests completed successfully!"