Skip to content

Conversation

@ivanvc
Copy link
Member

@ivanvc ivanvc commented Oct 30, 2025

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).

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ivanvc ivanvc mentioned this pull request Oct 30, 2025
32 tasks
@ivanvc ivanvc force-pushed the migrate-test-unit-to-use-workspace branch 5 times, most recently from 58b4e34 to 6fabb4a Compare October 30, 2025 16:11
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>
@ivanvc ivanvc force-pushed the migrate-test-unit-to-use-workspace branch from 6fabb4a to 0f51f15 Compare October 30, 2025 16:45
@ivanvc
Copy link
Member Author

ivanvc commented Oct 30, 2025

/test all

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.14%. Comparing base (d661826) to head (0f51f15).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files

see 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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d661826...0f51f15. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@k8s-ci-robot
Copy link

@ivanvc: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-e2e-amd64 0f51f15 link true /test pull-etcd-e2e-amd64

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.

@k8s-ci-robot
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment