Skip to content

Commit

Permalink
[ci] always supply defaults for parallelism vars (#132520)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored May 19, 2022
1 parent a7012a3 commit 3effa89
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .buildkite/scripts/steps/code_coverage/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -uo pipefail

JOB=$BUILDKITE_PARALLEL_JOB
JOB_COUNT=$BUILDKITE_PARALLEL_JOB_COUNT
JOB=${BUILDKITE_PARALLEL_JOB:-0}
JOB_COUNT=${BUILDKITE_PARALLEL_JOB_COUNT:-1}

# a jest failure will result in the script returning an exit code of 10

Expand Down Expand Up @@ -35,4 +35,4 @@ while read -r config; do
# uses heredoc to avoid the while loop being in a sub-shell thus unable to overwrite exitCode
done <<< "$(find src x-pack packages -name jest.config.js -not -path "*/__fixtures__/*" | sort)"

exit $exitCode
exit $exitCode
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/test/ftr_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

export JOB_NUM=$BUILDKITE_PARALLEL_JOB
export JOB_NUM=${BUILDKITE_PARALLEL_JOB:-0}
export JOB=ftr-configs-${JOB_NUM}

FAILED_CONFIGS_KEY="${BUILDKITE_STEP_ID}${BUILDKITE_PARALLEL_JOB:-0}"
FAILED_CONFIGS_KEY="${BUILDKITE_STEP_ID}${JOB_NUM}"

# a FTR failure will result in the script returning an exit code of 10
exitCode=0
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/steps/test/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ is_test_execution_step

.buildkite/scripts/bootstrap.sh

JOB=${BUILDKITE_PARALLEL_JOB:-0}

echo '--- Jest'
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
checks-reporter-with-killswitch "Jest Unit Tests $((JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh jest.config.js
4 changes: 3 additions & 1 deletion .buildkite/scripts/steps/test/jest_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ is_test_execution_step

.buildkite/scripts/bootstrap.sh

JOB=${BUILDKITE_PARALLEL_JOB:-0}

echo '--- Jest Integration Tests'
checks-reporter-with-killswitch "Jest Integration Tests $((BUILDKITE_PARALLEL_JOB+1))" \
checks-reporter-with-killswitch "Jest Integration Tests $((JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh jest.integration.config.js
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

export JOB=$BUILDKITE_PARALLEL_JOB
export JOB=${BUILDKITE_PARALLEL_JOB:-0}

# a jest failure will result in the script returning an exit code of 10
exitCode=0
Expand Down

0 comments on commit 3effa89

Please sign in to comment.