-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Migrate unit tests to use Go workspace #20872
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
base: main
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivanvc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
58b4e34 to
6fabb4a
Compare
Introduce the new functions: run_go_tests and run_go_test_expanding_packages, which implements (without Shellcheck exceptions) the old behavior from go_test, simplifying the arguments received. Replaced the three possible values mode with: 1. keep_going: By using the KEEP_GOING_TESTS environment variable. This mode expanded the relative modules; it can be run by using run_go_tests_expanding_packages. 2. parallel: It worked without expanding the relative modules with the absolute modules. Therefore, this mode can be run directly using run_go_tests. 3. fail_fast: By adding an argument "-failfast", and not setting the KEEP_GOING_TESTS environment variable. The argument flags_for_package_func can be replaced by regular arguments passed to the function. These two changes simplify the complexity of the go test wrapper function and allow further customization in the callers. The JUnit XML generation works the same way, by reading the JUNIT_REPORT_DIR or ARTIFACTS environment variable. It generates the same reports. Temporarily introduce the get_junit_filename_prefix function, as a replacement for junitFilenamePrefix. The latter will be removed once all test targets are using the new functions. Finally, update the unit tests function to make use of the new functions, and allow running the tests by using the workspace (i.e., there's no need to change directories anymore). Signed-off-by: Ivan Valdes <ivan@vald.es>
6fabb4a to
0f51f15
Compare
|
/test all |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 26 files with indirect coverage changes @@ Coverage Diff @@
## main #20872 +/- ##
==========================================
- Coverage 69.22% 69.14% -0.09%
==========================================
Files 422 422
Lines 34822 34809 -13
==========================================
- Hits 24106 24067 -39
- Misses 9323 9344 +21
- Partials 1393 1398 +5 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@ivanvc: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Introduce the new functions: run_go_tests and
run_go_test_expanding_packages, which implements (without Shellcheck exceptions) the old behavior from go_test, simplifying the arguments received.
Replaced the three possible values mode with:
The argument flags_for_package_func can be replaced by regular arguments passed to the function.
These two changes simplify the complexity of the go test wrapper function and allow further customization in the callers.
The JUnit XML generation works the same way, by reading the JUNIT_REPORT_DIR or ARTIFACTS environment variable. It generates the same reports.
Temporarily introduce the get_junit_filename_prefix function, as a replacement for junitFilenamePrefix. The latter will be removed once all test targets are using the new functions.
Finally, update the unit tests function to make use of the new functions, and allow running the tests by using the workspace (i.e., there's no need to change directories anymore).
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.