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

Add support to run full test suite in run-e2e.sh #6694

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Jun 25, 2024

Description

Follow up to #6685

This PR allows a full test suite to be run locally.

Note: not all tests will pass locally, since they do things like change params which will mess with each other.

They also do not yet run in parallel. This will be done in a followup.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@@ -31,13 +31,7 @@ function _verify_dependencies() {

# _select_test_config lets you dynamically select a test config for the specific test.
function _select_test_config() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

drive by fix

Comment on lines +53 to +77
function run_test() {
# if the dev configs directory is present, enable fzf completion to select a test config file to use.

# if test is set, that is used directly, otherwise the test can be interactively provided if fzf is installed.
TEST="$(_get_test ${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.
# it shouldn't take 30m, but the wasm test can be quite slow, so we can be generous.
go test -v "${test_dir}" --run ${ENTRY_POINT} -testify.m ^${TEST}$ -timeout 30m
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was the existing logic that was pulled into a new fn

@chatton chatton marked this pull request as ready for review June 26, 2024 12:31
@chatton chatton added e2e priority PRs that need prompt reviews labels Jun 26, 2024
…-single-test-suite-instead-on-each-host-instead-of-one-test-per-host
@chatton chatton mentioned this pull request Jun 27, 2024
10 tasks
…-single-test-suite-instead-on-each-host-instead-of-one-test-per-host
…-single-test-suite-instead-on-each-host-instead-of-one-test-per-host
…-single-test-suite-instead-on-each-host-instead-of-one-test-per-host
…-single-test-suite-instead-on-each-host-instead-of-one-test-per-host
Copy link

sonarcloud bot commented Jul 1, 2024

test_file="$(grep --recursive --files-with-matches './tests' -e "${ENTRY_POINT}")"
test_dir="$(dirname $test_file)"

# TODO: add the -p flag to run tests in parallel
Copy link
Contributor

Choose a reason for hiding this comment

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

[q] do we have an issue to make sure we don't forget? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all this stuff is kind of building up to close this issue #5317 , so that won't be complete until we can actually run tests in parallel

@chatton chatton added this pull request to the merge queue Jul 1, 2024
Merged via the queue into main with commit 8cf632a Jul 1, 2024
84 checks passed
@chatton chatton deleted the cian/issue#6677-update-ci-workflows-to-run-a-single-test-suite-instead-on-each-host-instead-of-one-test-per-host branch July 1, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants