Skip to content

Commit

Permalink
fixup: Wrapping cli's is trickier than expected
Browse files Browse the repository at this point in the history
- not sure it is ideal to have to wrap commands
  - how does `go tool` do it?
- maybe stick to installing and using the installed version
  - `go run` makes sense for local commands, but why for ones in
    different repos?
  • Loading branch information
marun committed Dec 23, 2024
1 parent 766bb37 commit 147a44b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
7 changes: 0 additions & 7 deletions scripts/ginkgo.sh

This file was deleted.

8 changes: 2 additions & 6 deletions scripts/tests.e2e.bootstrap_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ function ensure_command {
fi
}

# Ensure the kubectl command is available
KUBECTL_VERSION=v1.30.2
ensure_command kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/${OS}/${ARCH}/kubectl"

# Ensure the kind command is available
KIND_VERSION=v0.23.0
ensure_command kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-${OS}-${ARCH}"
Expand All @@ -61,7 +57,7 @@ ensure_command "kind-with-registry.sh" "https://raw.githubusercontent.com/kubern
# Deploy a kind cluster with a local registry. Include the local bin in the path to
# ensure locally installed kind and kubectl are available since the script expects to
# call them without a qualifying path.
PATH="${PWD}/bin:$PATH" bash -x "${PWD}/bin/kind-with-registry.sh"
PATH="${PWD}/tools:${PWD}/bin:$PATH" bash -x "${PWD}/bin/kind-with-registry.sh"

KUBECONFIG="$HOME/.kube/config" PATH="${PWD}/bin:$PATH" \
./scripts/ginkgo.sh -v ./tests/fixture/bootstrapmonitor/e2e
./tools/ginkgo -v ./tests/fixture/bootstrapmonitor/e2e
2 changes: 1 addition & 1 deletion scripts/tests.e2e.existing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function print_separator {
function cleanup {
print_separator
echo "cleaning up reusable network"
./scripts/ginkgo.sh -v ./tests/e2e -- --stop-network
./tools/ginkgo -v ./tests/e2e -- --stop-network
}
trap cleanup EXIT

Expand Down
10 changes: 5 additions & 5 deletions scripts/tests.e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ E2E_ARGS="--avalanchego-path=${AVALANCHEGO_PATH}"

#################################
# Determine ginkgo args
GINKGO_ARGS=""
GINKGO_ARGS="--ginkgo.v"
if [[ -n "${E2E_SERIAL:-}" ]]; then
# Specs will be executed serially. This supports running e2e tests in CI
# where parallel execution of tests that start new nodes beyond the
Expand All @@ -46,17 +46,17 @@ else
# since the test binary isn't capable of executing specs in
# parallel.
echo "tests will be executed in parallel"
GINKGO_ARGS="-p"
GINKGO_ARGS=+" --ginkgo.p"
fi
# Reference: https://onsi.github.io/ginkgo/#spec-randomization
if [[ -n "${E2E_RANDOM_SEED:-}" ]]; then
# Supply a specific seed to simplify reproduction of test failures
GINKGO_ARGS+=" --seed=${E2E_RANDOM_SEED}"
GINKGO_ARGS+=" --ginkgo.seed=${E2E_RANDOM_SEED}"
else
# Execute in random order to identify unwanted dependency
GINKGO_ARGS+=" --randomize-all"
GINKGO_ARGS+=" --ginkgo.randomize-all"
fi

#################################
# shellcheck disable=SC2086
./scripts/ginkgo.sh ${GINKGO_ARGS} -v ./tests/e2e -- "${E2E_ARGS[@]}" "${@}"
./tools/ginkgo ./tests/e2e -- ${GINKGO_ARGS} "${E2E_ARGS[@]}" "${@}"
2 changes: 1 addition & 1 deletion scripts/tests.upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ source ./scripts/constants.sh
#################################
# By default, it runs all upgrade test cases!
echo "running upgrade tests against the local cluster with ${AVALANCHEGO_PATH}"
./scripts/ginkgo.sh -v ./tests/upgrade -- \
./tools/ginkgo -v ./tests/upgrade -- \
--avalanchego-path="/tmp/avalanchego-v${VERSION}/avalanchego" \
--avalanchego-path-to-upgrade-to="${AVALANCHEGO_PATH}"
6 changes: 3 additions & 3 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
```bash
./scripts/build.sh # Builds avalanchego for use in deploying a test network
./scripts/build_xsvm.sh # Builds xsvm for use in deploying a test network with a subnet
./scripts/ginkgo.sh -v ./tests/e2e -- --avalanchego-path=./build/avalanchego
./tools/ginkgo ./tests/e2e -- --ginkgo.v --avalanchego-path=./build/avalanchego
```

See [`tests.e2e.sh`](../../scripts/tests.e2e.sh) for an example.
Expand All @@ -24,7 +24,7 @@ primarily target the X-Chain:


```bash
./scripts/ginkgo.sh -v --label-filter=x ./tests/e2e -- --avalanchego-path=./build/avalanchego
./tools/ginkgo ./tests/e2e -- --ginkgo.v --ginkgo.label-filter=x --avalanchego-path=./build/avalanchego
```

The ginkgo docs provide further detail on [how to compose label
Expand Down Expand Up @@ -97,5 +97,5 @@ these bootstrap checks during development, set the
`E2E_SKIP_BOOTSTRAP_CHECKS` env var to a non-empty value:

```bash
E2E_SKIP_BOOTSTRAP_CHECKS=1 ./scripts/ginkgo.sh -v ./tests/e2e ...
E2E_SKIP_BOOTSTRAP_CHECKS=1 ./tools/ginkgo ./tests/e2e ...
```

0 comments on commit 147a44b

Please sign in to comment.