Skip to content

Commit

Permalink
Revert "Return 1 instead of 255"
Browse files Browse the repository at this point in the history
This reverts commit 36ae28d.

Signed-off-by: Ivan Valdes <[email protected]>
  • Loading branch information
ivanvc committed May 5, 2024
1 parent 36ae28d commit bef3525
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REPOSITORY="${REPOSITORY:[email protected]:etcd-io/etcd.git}"

if [ -z "$VER" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 1
exit 255
fi

function setup_env {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source ./scripts/test_lib.sh
VERSION=${1:-}
if [ -z "${VERSION}" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 1
exit 255
fi

if ! command -v docker >/dev/null; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/genproto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shopt -s globstar

if ! [[ "$0" =~ scripts/genproto.sh ]]; then
echo "must be run from repository root"
exit 1
exit 255
fi

# Set SED variable
Expand All @@ -34,7 +34,7 @@ if [[ $(protoc --version | cut -f2 -d' ') != "3.20.3" ]]; then
"arm64") file="aarch_64" ;;
*)
echo "Unsupported architecture: ${arch}"
exit 1
exit 255
;;
esac

Expand Down
28 changes: 14 additions & 14 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ function generic_checker {
if ! output=$("${cmd[@]}"); then
echo "${output}"
log_error -e "FAIL: '${cmd[*]}' checking failed (!=0 return code)"
return 1
return 255
fi
if [ -n "${output}" ]; then
echo "${output}"
log_error -e "FAIL: '${cmd[*]}' checking failed (printed output)"
return 1
return 255
fi
}

Expand Down Expand Up @@ -264,7 +264,7 @@ function cov_pass {
# shellcheck disable=SC2153
if [ -z "${COVERDIR:-}" ]; then
log_error "COVERDIR undeclared"
return 1
return 255
fi

local coverdir
Expand Down Expand Up @@ -317,7 +317,7 @@ function cov_pass {
done
log_warning "Despite failures, you can see partial report:"
log_warning " go tool cover -html ${cover_out_file}"
return 1
return 255
fi

log_success "done :) [see report: go tool cover -html ${cover_out_file}]"
Expand Down Expand Up @@ -444,7 +444,7 @@ function receiver_name_for_package {
log_error "Mismatched receiver for $recv..."
grep "$recv" "${gofiles[@]}" | grep 'func ('
done
return 1
return 255
fi
}

Expand All @@ -469,17 +469,17 @@ function goword_for_package {
# only check for broke exported godocs
if gowordRes=$(run_go_tool "github.com/chzchzchz/goword" -use-spell=false "${gofiles[@]}" | grep godoc-export | sort); then
log_error -e "goword checking failed:\\n${gowordRes}"
return 1
return 255
fi
if [ -n "$gowordRes" ]; then
log_error -e "goword checking returned output:\\n${gowordRes}"
return 1
return 255
fi
}


function goword_pass {
run_for_modules goword_for_package || return 1
run_for_modules goword_for_package || return 255
}

function go_fmt_for_package {
Expand Down Expand Up @@ -512,13 +512,13 @@ function bom_pass {

if [ "${code}" -ne 0 ] ; then
log_error -e "license-bill-of-materials (code: ${code}) failed with:\\n${output}"
return 1
return 255
else
echo "${output}" > "bom-now.json.tmp"
fi
if ! diff ./bill-of-materials.json bom-now.json.tmp; then
log_error "modularized licenses do not match given bill of materials"
return 1
return 255
fi
rm bom-now.json.tmp
}
Expand All @@ -528,7 +528,7 @@ function bom_pass {
function dump_deps_of_module() {
local module
if ! module=$(run go list -m); then
return 1
return 255
fi
run go list -f "{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},${module}{{end}}{{end}}" -m all
}
Expand Down Expand Up @@ -629,7 +629,7 @@ function mod_tidy_for_module {

if [ "${tmpFileGoModInSync}" -ne 0 ]; then
log_error "${PWD}/go.mod is not in sync with 'go mod tidy'"
return 1
return 255
fi
set -e
}
Expand Down Expand Up @@ -660,7 +660,7 @@ function run_pass {
if [ "$KEEP_GOING_SUITE" = true ]; then
return 2
else
exit 1
exit 255
fi
fi
}
Expand All @@ -676,7 +676,7 @@ for pass in $PASSES; do
done
if [ "$fail_flag" = true ]; then
log_error "There was FAILURE in the test suites ran. Look above log detail"
exit 1
exit 255
fi

log_success "SUCCESS"
6 changes: 3 additions & 3 deletions scripts/test_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ROOT_MODULE="go.etcd.io/etcd"

if [[ "$(go list)" != "${ROOT_MODULE}/v3" ]]; then
echo "must be run from '${ROOT_MODULE}/v3' module directory"
exit 1
exit 255
fi

function set_root_dir {
Expand Down Expand Up @@ -322,7 +322,7 @@ function go_test {
# shellcheck disable=SC2086
if ! unpacked_packages=($(go list ${packages})); then
log_error "Cannot resolve packages: ${packages}"
return 1
return 255
fi
fi

Expand Down Expand Up @@ -372,7 +372,7 @@ function tool_exists {
local instruction="${2}"
if ! command -v "${tool}" >/dev/null; then
log_warning "Tool: '${tool}' not found on PATH. ${instruction}"
return 1
return 255
fi
}

Expand Down

0 comments on commit bef3525

Please sign in to comment.