Parallelize external test runs on CircleCI

This commit is contained in:
Kamil Śliwak 2021-10-28 12:46:34 +02:00
parent fbc48e3029
commit 834f9d3a6e
7 changed files with 36 additions and 5 deletions

View File

@ -943,6 +943,8 @@ jobs:
default: 14
docker:
- image: circleci/node:<<parameters.nodejs_version>>
# NOTE: Each external test does 3 separate compile&test runs
parallelism: 3
environment:
TERM: xterm
COMPILE_ONLY: <<parameters.compile_only>>

View File

@ -38,6 +38,10 @@ function colony_test
local min_optimizer_level=3
local max_optimizer_level=3
local selected_optimizer_levels
selected_optimizer_levels=$(circleci_select_steps "$(seq "$min_optimizer_level" "$max_optimizer_level")")
print_optimizer_levels_or_exit "$selected_optimizer_levels"
setup_solcjs "$DIR" "$SOLJSON"
download_project "$repo" "$branch" "$DIR"
@ -54,7 +58,7 @@ function colony_test
replace_version_pragmas
force_solc_modules "${DIR}/solc"
for level in $(seq "$min_optimizer_level" "$max_optimizer_level"); do
for level in $selected_optimizer_levels; do
truffle_run_test "$config_file" "${DIR}/solc" "$level" compile_fn test_fn
done
}

View File

@ -24,6 +24,15 @@ set -e
CURRENT_EVM_VERSION=london
function print_optimizer_levels_or_exit
{
local selected_levels="$1"
[[ $selected_levels != "" ]] || { printWarning "No steps to run. Exiting."; exit 0; }
printLog "Selected optimizer levels: ${selected_levels}"
}
function verify_input
{
if [ ! -f "$1" ]; then

View File

@ -38,6 +38,10 @@ function ens_test
local min_optimizer_level=1
local max_optimizer_level=3
local selected_optimizer_levels
selected_optimizer_levels=$(circleci_select_steps "$(seq "$min_optimizer_level" "$max_optimizer_level")")
print_optimizer_levels_or_exit "$selected_optimizer_levels"
setup_solcjs "$DIR" "$SOLJSON"
download_project "$repo" "$branch" "$DIR"
@ -52,7 +56,7 @@ function ens_test
replace_version_pragmas
force_solc_modules "${DIR}/solc"
for level in $(seq "$min_optimizer_level" "$max_optimizer_level"); do
for level in $selected_optimizer_levels; do
truffle_run_test "$config_file" "${DIR}/solc" "$level" compile_fn test_fn
done
}

View File

@ -39,6 +39,10 @@ function gnosis_safe_test
local min_optimizer_level=2
local max_optimizer_level=3
local selected_optimizer_levels
selected_optimizer_levels=$(circleci_select_steps "$(seq "$min_optimizer_level" "$max_optimizer_level")")
print_optimizer_levels_or_exit "$selected_optimizer_levels"
setup_solcjs "$DIR" "$SOLJSON"
download_project "$repo" "$branch" "$DIR"
@ -53,7 +57,7 @@ function gnosis_safe_test
replace_version_pragmas
force_solc_modules "${DIR}/solc"
for level in $(seq "$min_optimizer_level" "$max_optimizer_level"); do
for level in $selected_optimizer_levels; do
truffle_run_test "$config_file" "${DIR}/solc" "$level" compile_fn test_fn
done
}

View File

@ -38,6 +38,10 @@ function gnosis_safe_test
local min_optimizer_level=2
local max_optimizer_level=3
local selected_optimizer_levels
selected_optimizer_levels=$(circleci_select_steps "$(seq "$min_optimizer_level" "$max_optimizer_level")")
print_optimizer_levels_or_exit "$selected_optimizer_levels"
setup_solcjs "$DIR" "$SOLJSON"
download_project "$repo" "$branch" "$DIR"
@ -51,7 +55,7 @@ function gnosis_safe_test
replace_version_pragmas
force_solc_modules "${DIR}/solc"
for level in $(seq "$min_optimizer_level" "$max_optimizer_level"); do
for level in $selected_optimizer_levels; do
truffle_run_test "$config_file" "${DIR}/solc" "$level" compile_fn test_fn
done
}

View File

@ -38,6 +38,10 @@ function zeppelin_test
local min_optimizer_level=1
local max_optimizer_level=3
local selected_optimizer_levels
selected_optimizer_levels=$(circleci_select_steps "$(seq "$min_optimizer_level" "$max_optimizer_level")")
print_optimizer_levels_or_exit "$selected_optimizer_levels"
setup_solcjs "$DIR" "$SOLJSON"
download_project "$repo" "$branch" "$DIR"
@ -48,7 +52,7 @@ function zeppelin_test
replace_version_pragmas
force_solc_modules "${DIR}/solc"
for level in $(seq "$min_optimizer_level" "$max_optimizer_level"); do
for level in $selected_optimizer_levels; do
truffle_run_test "$config_file" "${DIR}/solc" "$level" compile_fn test_fn
done
}