-
Notifications
You must be signed in to change notification settings - Fork 586
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
chatton
merged 7 commits into
main
from
cian/issue#3255-update-make-e2e-test-so-that-you-only-need-the-test-name
Mar 13, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
41d5739
determine test suite based on test name
chatton e920335
update run-e2e.sh to require only the test name
chatton f1a06c9
merge main
chatton b1bf969
use dir instead of file
chatton 734b49e
Merge branch 'main' into cian/issue#3255-update-make-e2e-test-so-that…
chatton 47d80d6
Merge branch 'main' into cian/issue#3255-update-make-e2e-test-so-that…
chatton 5321731
correct grep pattern and remove entrypoint from use in CI
chatton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}$ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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