-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update make e2e test so that you only need the test name (#3281)
- Loading branch information
Showing
6 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
set -eo pipefail | ||
|
||
ENTRY_POINT="${1}" | ||
TEST="${2}" | ||
TEST="${1}" | ||
ENTRY_POINT="${2:-}" | ||
|
||
export CHAIN_A_TAG="${CHAIN_A_TAG:-main}" | ||
export CHAIN_IMAGE="${CHAIN_IMAGE:-ghcr.io/cosmos/ibc-go-simd}" | ||
export CHAIN_BINARY="${CHAIN_BINARY:-simd}" | ||
|
||
go test -v ./tests/... --run ${ENTRY_POINT} -testify.m ^${TEST}$ | ||
# if jq is installed, we can automatically determine the test entrypoint. | ||
if command -v jq > /dev/null; then | ||
cd .. | ||
ENTRY_POINT="$(go run -mod=readonly cmd/build_test_matrix/main.go | jq -r --arg TEST "${TEST}" '.include[] | select( .test == $TEST) | .entrypoint')" | ||
cd - > /dev/null | ||
fi | ||
|
||
|
||
# find the name of the file that has this test in it. | ||
test_file="$(grep --recursive --files-with-matches './' -e "${TEST}()")" | ||
|
||
# we run the test on the directory as specific files may reference types in other files but within the package. | ||
test_dir="$(dirname $test_file)" | ||
|
||
# run the test file directly, this allows log output to be streamed directly in the terminal sessions | ||
# without needed to wait for the test to finish. | ||
go test -v "${test_dir}" --run ${ENTRY_POINT} -testify.m ^${TEST}$ |