Skip to content

Commit 4b2e034

Browse files
[testing] Add local kube support for load tests (#3986)
1 parent 4503725 commit 4b2e034

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Taskfile.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ tasks:
232232
- task: generate-load-contract-bindings
233233
- task: build
234234
- cmd: go run ./tests/load/c/main --avalanchego-path=./build/avalanchego {{.CLI_ARGS}}
235+
236+
test-load-kube:
237+
desc: Runs load tests against a network deployed to kube
238+
cmds:
239+
- task: generate-load-contract-bindings
240+
- cmd: bash -x ./scripts/tests.load.kube.sh {{.CLI_ARGS}}
235241

236242
test-load-exclusive:
237243
desc: Runs load tests against kube with exclusive scheduling

scripts/tests.load.kube.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# Run load test against nodes deployed to a kind cluster
6+
7+
if ! [[ "$0" =~ scripts/tests.load.kube.sh ]]; then
8+
echo "must be run from repository root"
9+
exit 255
10+
fi
11+
12+
# This script will use kubeconfig arguments if supplied
13+
./scripts/start_kind_cluster.sh "$@"
14+
15+
# Build AvalancheGo image
16+
AVALANCHEGO_IMAGE="localhost:5001/avalanchego"
17+
DOCKER_IMAGE="$AVALANCHEGO_IMAGE" FORCE_TAG_LATEST=1 ./scripts/build_image.sh
18+
19+
go run ./tests/load/c/main --runtime=kube --kube-image="$AVALANCHEGO_IMAGE" "$@"

0 commit comments

Comments
 (0)