fix(demo): make validation suite runnable and shellcheck-clean
validate-all.sh aborted after the very first check because its
post-increment counters (`((VAR++))`) return exit status 1 when the old
value is 0, and `set -e` terminated the script. Use arithmetic
assignment so the suite runs to completion.
Add a .shellcheckrc to suppress the SC1090/SC1091 warnings that are
inherent to the environment-driven design (dynamic `source` of demo.env),
and drop an unused variable in demo-test.sh, so every script passes
shellcheck cleanly.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
# ShellCheck configuration for the TSYS Developer Support Stack
|
||||||
|
# These rules are inherent to the environment-driven (dynamic source) design:
|
||||||
|
# SC1090 - can't follow non-constant source (e.g. `source "$ENV_FILE"`)
|
||||||
|
# SC1091 - not following external file specified as input (demo.env)
|
||||||
|
disable=SC1090,SC1091
|
||||||
@@ -74,7 +74,7 @@ test_service_health() {
|
|||||||
log_test "Service health"
|
log_test "Service health"
|
||||||
local unhealthy=0
|
local unhealthy=0
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
local name status
|
local name
|
||||||
name=$(echo "$line" | awk '{print $1}')
|
name=$(echo "$line" | awk '{print $1}')
|
||||||
[[ "$name" == "NAMES" || -z "$name" ]] && continue
|
[[ "$name" == "NAMES" || -z "$name" ]] && continue
|
||||||
if echo "$line" | grep -q "(healthy)"; then
|
if echo "$line" | grep -q "(healthy)"; then
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ BLUE='\033[0;34m'
|
|||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
log_validation() { echo -e "${BLUE}[VALIDATE]${NC} $1"; }
|
log_validation() { echo -e "${BLUE}[VALIDATE]${NC} $1"; }
|
||||||
log_pass() { echo -e "${GREEN}[PASS]${NC} $1"; ((VALIDATION_PASSED++)); }
|
log_pass() { echo -e "${GREEN}[PASS]${NC} $1"; VALIDATION_PASSED=$((VALIDATION_PASSED + 1)); }
|
||||||
log_fail() { echo -e "${RED}[FAIL]${NC} $1"; ((VALIDATION_FAILED++)); }
|
log_fail() { echo -e "${RED}[FAIL]${NC} $1"; VALIDATION_FAILED=$((VALIDATION_FAILED + 1)); }
|
||||||
|
|
||||||
validate_yaml_files() {
|
validate_yaml_files() {
|
||||||
log_validation "Validating YAML files with yamllint..."
|
log_validation "Validating YAML files with yamllint..."
|
||||||
|
|||||||
Reference in New Issue
Block a user