fix: fail test exec if at least one test fail
This commit is contained in:
parent
e5b23dad6b
commit
284ffbf68f
4 changed files with 24 additions and 3 deletions
2
.github/workflows/dev-push-check.yml
vendored
2
.github/workflows/dev-push-check.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
name: dev-push-check
|
name: dev-push-check
|
||||||
run-name: ${{ github.actor }} pushed new code to {{ github.ref }} 💻
|
run-name: ${{ github.actor }} pushed new code 💻
|
||||||
on: [push] #, pull_request]
|
on: [push] #, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
lint_shellcheck:
|
lint_shellcheck:
|
||||||
|
|
|
@ -29,7 +29,7 @@ EOF
|
||||||
echo "Current DIR: $CURRENT_DIR"
|
echo "Current DIR: $CURRENT_DIR"
|
||||||
|
|
||||||
# link current repo to plugin list
|
# link current repo to plugin list
|
||||||
ln -sf ~/.tmux/plugins/tmux-gruvbox/ "$CURRENT_DIR/../"
|
ln -sf ~/.tmux/plugins/tmux-gruvbox/ "$CURRENT_DIR/../../"
|
||||||
|
|
||||||
helper_install_tpm_plugins
|
helper_install_tpm_plugins
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ EOF
|
||||||
# get status of something from theme
|
# get status of something from theme
|
||||||
_status_left_current=$(tmux show-option -gqv status-left)
|
_status_left_current=$(tmux show-option -gqv status-left)
|
||||||
if [[ "$STATUS_LEFT_DEFAULT" != "$_status_left_current" ]]; then
|
if [[ "$STATUS_LEFT_DEFAULT" != "$_status_left_current" ]]; then
|
||||||
helper_print_fail "status-left did not match"
|
helper_print_fail_and_exit "status-left did not match" # fail fast
|
||||||
else
|
else
|
||||||
helper_print_success "status-left match"
|
helper_print_success "status-left match"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,10 +4,24 @@ CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
set -e # exit on error
|
set -e # exit on error
|
||||||
|
declare -i _countFailures
|
||||||
|
local _files
|
||||||
|
_countFailures=0
|
||||||
_files=$(find "$CURRENT_DIR" -name "test_linux_*" -type f)
|
_files=$(find "$CURRENT_DIR" -name "test_linux_*" -type f)
|
||||||
for test in $_files; do
|
for test in $_files; do
|
||||||
bash -c "$test"
|
bash -c "$test"
|
||||||
|
|
||||||
|
# run all and count failures
|
||||||
|
retVal=$?
|
||||||
|
if [ $retVal -eq 1 ]; then
|
||||||
|
_countFailures+=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# check if anything failed and fail
|
||||||
|
if [ "$_countFailures" -gt 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
helper_teardown() {
|
helper_teardown() {
|
||||||
|
echo "TEARDOWN"
|
||||||
rm -rf ~/.tmux.conf
|
rm -rf ~/.tmux.conf
|
||||||
rm -rf ~/.tmux/
|
rm -rf ~/.tmux/
|
||||||
tmux kill-server >/dev/null 2>&1
|
tmux kill-server >/dev/null 2>&1
|
||||||
|
@ -11,6 +12,7 @@ helper_tearup_linux() {
|
||||||
echo "NOT LINUX. Failed & exit."
|
echo "NOT LINUX. Failed & exit."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "TEARUP LINUX"
|
||||||
|
|
||||||
# install software
|
# install software
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
|
@ -45,3 +47,8 @@ helper_print_success_and_exit() {
|
||||||
helper_install_tpm_plugins() {
|
helper_install_tpm_plugins() {
|
||||||
bash -c "${HOME}/.tmux/plugins/tpm/scripts/install_plugins.sh install_plugins"
|
bash -c "${HOME}/.tmux/plugins/tpm/scripts/install_plugins.sh install_plugins"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helper_get_project_root_dir() {
|
||||||
|
_current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
echo "${_current_dir}/../"
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue