Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
feat(tests): add git submodules update test
  • Loading branch information
Airscript committed Aug 13, 2022
commit 574d8542d13f4febade01a6962ad74962938e181
7 changes: 4 additions & 3 deletions scripts/shared/git-submodules.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
if [ ! "$1" = "compose" ]; then
git submodule update --init --recursive
echo 1
fi
echo "Git submodule update executed."

echo 0
else
echo "Git submodule update skipped."
fi
18 changes: 18 additions & 0 deletions tests/shared.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!./tests/bats/bin/bats

setup() {
load 'libraries/bats-support/load'
load 'libraries/bats-assert/load'
source ./tests/mocks.sh
apk add git
}

@test "Add Git Submodules" {
run ./scripts/shared/git-submodules.sh
assert_output "$ADD_GIT_SUBMODULE_EXECUTED"
}

@test "Skip Git Submodules" {
run ./scripts/shared/git-submodules.sh compose
assert_output "$ADD_GIT_SUBMODULE_SKIPPED"
}