diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 3937c5ddb65ef18f638b9b0bf1d72e8a74a13dc7..0de15285ed083e130d8de45716d01fafc2eeba6a 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -294,17 +294,36 @@ for role in "${roles_to_test[@]}"; do # Run the linters. if [[ $role_test_result == 0 ]]; then + info "Executing linter (Flake8) on files found in $role_dir" 2>&1 | tee -a "$report_file" flake8 . 2>&1 | tee -a "$report_file" last_pipe_status="${PIPESTATUS[0]}" - [[ $last_pipe_status == 0 ]] || role_test_result="$last_pipe_status" + if [[ $last_pipe_status == 0 ]]; then + success "Linter completed successfully." 2>&1 | tee -a "$report_file" + else + error "Linter (Flake8) failed." 2>&1 | tee -a "$report_file" + role_test_result="$last_pipe_status" + fi + info "Executing linter (yamllint) on files found in $role_dir" 2>&1 | tee -a "$report_file" yamllint . 2>&1 | tee -a "$report_file" last_pipe_status="${PIPESTATUS[0]}" - [[ $last_pipe_status == 0 ]] || role_test_result="$last_pipe_status" + if [[ $last_pipe_status == 0 ]]; then + success "Linter completed successfully." 2>&1 | tee -a "$report_file" + else + error "Linter (yamllint) failed." 2>&1 | tee -a "$report_file" + role_test_result="$last_pipe_status" + fi + info "Executing linter (ansible-lint) on files found in $role_dir" 2>&1 | tee -a "$report_file" ansible-lint -q . 2>&1 | tee -a "$report_file" last_pipe_status="${PIPESTATUS[0]}" - [[ $last_pipe_status == 0 ]] || role_test_result="$last_pipe_status" + if [[ $last_pipe_status == 0 ]]; then + success "Linter completed successfully." 2>&1 | tee -a "$report_file" + else + error "Linter (ansible-lint) failed." 2>&1 | tee -a "$report_file" + role_test_result="$last_pipe_status" + fi + fi # Run the unit/functional tests (if requested).