Skip to content

Commit

Permalink
ci: refactor local cluster tests (#31730)
Browse files Browse the repository at this point in the history
* ci: separate local cluster tests by nextest

* parallelism => 6

* Revert "parallelism => 6"

This reverts commit 5c27135.
  • Loading branch information
yihau authored May 24, 2023
1 parent 03e0a9e commit 239a7ba
Show file tree
Hide file tree
Showing 8 changed files with 1,776 additions and 1,869 deletions.
15 changes: 14 additions & 1 deletion .buildkite/scripts/build-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ partitions=$(
EOF
)

local_cluster_partitions=$(
cat <<EOF
{
"name": "local-cluster",
"command": ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/stable/run-local-cluster-partially.sh",
"timeout_in_minutes": 30,
"agent": "$agent",
"parallelism": 5,
"retry": 3
}
EOF
)

localnet=$(
cat <<EOF
{
Expand All @@ -33,4 +46,4 @@ EOF
)

# shellcheck disable=SC2016
group "stable" "$partitions" "$localnet"
group "stable" "$partitions" "$local_cluster_partitions" "$localnet"
16 changes: 0 additions & 16 deletions ci/buildkite-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,6 @@ EOF
"Bench skipped as no .rs files were modified"
fi

command_step "local-cluster" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster.sh" \
40

command_step "local-cluster-flakey" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-flakey.sh" \
10

command_step "local-cluster-slow-1" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-slow-1.sh" \
40

command_step "local-cluster-slow-2" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-slow-2.sh" \
40

# Coverage...
if affects \
.rs$ \
Expand Down
16 changes: 0 additions & 16 deletions ci/buildkite-solana-private.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,6 @@ EOF
"Bench skipped as no .rs files were modified"
fi

command_step "local-cluster" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster.sh" \
40

command_step "local-cluster-flakey" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-flakey.sh" \
10

command_step "local-cluster-slow-1" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-slow-1.sh" \
40

command_step "local-cluster-slow-2" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-slow-2.sh" \
40

# Coverage...
if affects \
.rs$ \
Expand Down
24 changes: 24 additions & 0 deletions ci/stable/run-local-cluster-partially.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e

here="$(dirname "$0")"

#shellcheck source=ci/common/shared-functions.sh
source "$here"/../common/shared-functions.sh

#shellcheck source=ci/stable/common.sh
source "$here"/common.sh

INDEX=${1:-"$BUILDKITE_PARALLEL_JOB"}
: "${INDEX:?}"

LIMIT=${2:-"$BUILDKITE_PARALLEL_JOB_COUNT"}
: "${LIMIT:?}"

_ cargo nextest run \
--profile ci \
--config-file ./nextest.toml \
--package solana-local-cluster \
--test local_cluster \
--partition hash:"$((INDEX + 1))/$LIMIT" \
--test-threads=1
Loading

0 comments on commit 239a7ba

Please sign in to comment.