Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update make e2e test so that you only need the test name #3281

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cleanup-ibc-test-containers:
done

e2e-test: cleanup-ibc-test-containers
./scripts/run-e2e.sh $(entrypoint) $(test)
./scripts/run-e2e.sh $(test) $(entrypoint)

compatibility-tests:
./scripts/run-compatibility-tests.sh $(release_branch)
Expand Down
21 changes: 17 additions & 4 deletions e2e/scripts/run-e2e.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#!/bin/bash

set -euo pipefail
set -eo pipefail

ENTRY_POINT="${1}"
TEST="${2}"
TEST="${1}"
ENTRY_POINT="${2:-}"
Comment on lines +5 to +6
Copy link
Contributor Author

@chatton chatton Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST is required, but ENTRY_POINT is not


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 -
fi


# find the name of the file that has this test in it.
test_file="$(grep --recursive --files-with-matches './' -e "${TEST}")"

# 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_file}" --run ${ENTRY_POINT} -testify.m ^${TEST}$