Skip to content

Commit

Permalink
Address issues flagged by shellcheck
Browse files Browse the repository at this point in the history
A few new shellcheck issues have crept into the scripts. Make the
changes recommended by static analysis.

Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
  • Loading branch information
sykesm authored and denyeart committed May 19, 2020
1 parent 663a9bf commit d8b52ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dockerPull() {
three_digit_image_tag=$1
shift
#two_digit_image_tag is derived, e.g. "1.4", especially useful as a local tag for two digit references to most recent baseos, ccenv, javaenv, nodeenv patch releases
two_digit_image_tag=$(echo $three_digit_image_tag | cut -d'.' -f1,2)
two_digit_image_tag=$(echo "$three_digit_image_tag" | cut -d'.' -f1,2)
while [[ $# -gt 0 ]]
do
image_name="$1"
Expand Down
21 changes: 10 additions & 11 deletions scripts/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,23 @@
set -eu

fabric_dir="$(cd "$(dirname "$0")/.." && pwd)"
cd ${fabric_dir}
cd "$fabric_dir"

declare -a test_dirs
test_dirs=($(
go list -f '{{if or (len .TestGoFiles | ne 0) (len .XTestGoFiles | ne 0)}}{{println .Dir}}{{end}}' ./... | \
grep integration | \
sed "s,${fabric_dir},.,g"
))
while IFS='' read -r line; do test_dirs+=("$line"); done < <(
go list -f '{{ if or (len .TestGoFiles | ne 0) (len .XTestGoFiles | ne 0) }}{{ println .Dir }}{{ end }}' ./... | \
grep integration | \
sed s,"${fabric_dir}",.,g
)

total_agents=${SYSTEM_TOTALJOBSINPHASE:-1} # standard VSTS variables available using parallel execution; total number of parallel jobs running
agent_number=${SYSTEM_JOBPOSITIONINPHASE:-1} # current job position

declare -a dirs
test_count=${#test_dirs[@]}
for ((i = "$agent_number"; i <= "$test_count"; )); do
for ((i = "$agent_number"; i <= "${#test_dirs[@]}"; )); do
dirs+=("${test_dirs[$i - 1]}")
i=$((${i} + ${total_agents}))
i=$((i + total_agents))
done

printf "\nRunning the following test suites:\n\n$(echo ${dirs[*]} | tr -s ' ' '\n')\n\nStarting tests...\n\n"
ginkgo -keepGoing --slowSpecThreshold 60 ${dirs[*]}
printf "\nRunning the following test suites:\n\n%s\n\nStarting tests...\n\n" "$(echo "${dirs[@]}" | tr -s ' ' '\n')"
ginkgo -keepGoing --slowSpecThreshold 60 "${dirs[@]}"

0 comments on commit d8b52ed

Please sign in to comment.