Commit Graph
529 Commits
Author SHA1 Message Date
Wei Fu 7e0e973499 scripts/genproto.sh: update to use google.golang.org/protobuf
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2026-05-15 06:35:23 -04:00
robin-vidal 5874f816d7 scripts: fix SC2268 shellcheck warning in test_lib.sh
Remove x-prefix pattern in comparison that is no longer needed
in modern shells as per shellcheck SC2268.

Fixes #21710

Signed-off-by: robin-vidal <robin.vidal.pro@gmail.com>
2026-05-05 21:58:06 +02:00
Marek Siarkowicz f6c634d0cb Merge pull request #21153 from Himanshu-370/himanshu/fix-sync-toolchain-directive
fix: Move sync_go_toolchain_directive.sh to scripts/fix/
2026-05-03 22:53:11 +02:00
Marek Siarkowicz 1232319f99 Merge pull request #21679 from Jefftree/cov-common-tests
scripts: include tests/common in coverage pass
2026-04-28 18:49:51 +02:00
Jefftree 678d3a07e9 scripts: include tests/common in coverage pass for client/v3 wrappers
Signed-off-by: Jefftree <jeffrey.ying86@live.com>
2026-04-28 11:07:46 -04:00
Jefftree 84e612f39b etcdserverpb: add RangeStream RPC to the KV service
RangeStream is a server-streaming counterpart to Range. The server
splits the result into a sequence of RangeStreamResponse chunks, each
wrapping a RangeResponse, so a client can proto.Merge them together
and end up with what a single Range call would have returned.

Signed-off-by: Jefftree <jeffrey.ying86@live.com>
2026-04-24 19:04:39 -04:00
Himanshu-370 6cfa875f1c fix: Move sync_go_toolchain_directive.sh to scripts/fix/ with improvements
- Move sync_go_toolchain_directive.sh to scripts/fix/ directory
- Add ETCD_ROOT_DIR support for dynamic path resolution
- Integrate with test_lib.sh for consistent logging
- Add log_callout and log_success messages
- Keep original script name with underscore convention
- Update Makefile and verify_go_versions.sh references

Signed-off-by: Himanshu-370 <himanshuich20@gmail.com>
2026-04-24 14:59:13 +00:00
Sharath P J 277cad5fbd clarify cherry-pick workflow and reorganize script location
Signed-off-by: Sharath P J <pjsharath28@gmail.com>
2026-04-17 22:38:32 +05:30
Marek Siarkowicz 84dc6e5539 Merge pull request #21140 from Himanshu-370/himanshu/fix-bom.sh_file
fix: Create scripts/fix/bom.sh for bill-of-materials generation
2026-03-18 08:50:45 +01:00
Jordan Liggitt ce64b849d3 Ensure local and go bin are used in genproto
Signed-off-by: Jordan Liggitt <liggitt@google.com>
2026-02-10 22:26:05 -05:00
Jordan Liggitt 6531bf80bc Split out grpc generation
Signed-off-by: Jordan Liggitt <liggitt@google.com>
2026-02-10 10:24:25 -05:00
Jordan Liggitt 5406755e0b Switch to standard go packages
Signed-off-by: Jordan Liggitt <liggitt@google.com>
2026-02-10 10:21:44 -05:00
Benjamin Wang 073d46a558 Remove the v2 Request message
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2026-02-06 17:18:35 +00:00
Himanshu Singh 1c23ec68cd fix: Create scripts/fix/bom.sh and remove updatebom.sh
- Create scripts/fix/bom.sh to generate bill-of-materials.json
- Add intentional first execution to fetch dependencies (avoids dirty state in clean repos)
- Use load_workspace_relative_modules_for_bom for proper module list
- Protect go.sum and go.mod with temporary backups during generation
- Run license-bill-of-materials with GOOS=linux for consistent output
- Add ETCD_ROOT_DIR support for dynamic path resolution
- Update Makefile fix-bom target to use the new script
- Remove scripts/updatebom.sh (functionality now in scripts/fix/bom.sh)
- Use 'exit' instead of 'return' (return only works in functions/sourced scripts)
- Add || true to first BOM run to ignore expected failures
- Verified: bash syntax, shellcheck -x, make verify-shellcheck all passed

Signed-off-by: Himanshu Singh <himanshuich20@gmail.com>
2026-01-23 20:01:25 +00:00
Wei Fu 44c40540a9 scripts: do not eat error
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2026-01-16 10:31:26 -05:00
Marek Siarkowicz 593127083a Merge pull request #21109 from Himanshu-370/himanshu/fix-scriptFolder-structure
Update mod-tidy.sh  Makefile target to use stand-alone script
2026-01-15 11:41:37 +01:00
Himanshu Singh c7ad57fd24 fix: Create scripts/fix/mod-tidy.sh and refactor test.sh
- Create scripts/fix/mod-tidy.sh with proper workspace module iteration
- Remove go.sum files before tidy to ensure clean state (regenerated by go mod tidy)
- Use run wrapper for consistent command execution and logging
- Update Makefile fix-mod-tidy target to use the new script
- Add ETCD_ROOT_DIR support for dynamic path resolution
- Delete module_mod_tidy_fix and mod_tidy_fix_pass functions from scripts/test.sh
  (functionality moved to scripts/fix/mod-tidy.sh)

Signed-off-by: Himanshu Singh <himanshuich20@gmail.com>
2026-01-14 22:22:20 +00:00
Benjamin Wang 6ba121422e Merge pull request #21095 from ivanvc/simplify-running-test-take-2
Simplify running tests
2026-01-10 13:44:00 +00:00
Marek Siarkowicz 168274f068 Merge pull request #21094 from aojea/grpc_experimental
verify grpc experimental apis
2026-01-10 09:02:17 +01:00
Ivan Valdes 64f366f2a7 Simplify running tests
* Remove iteration over packages; with the Go workspace, we don't need
  to iterate.
* Replace `KEEP_GOING_TESTS` behavior by using the Go `-failfast` test
  flag.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2026-01-09 13:58:50 -08:00
Antonio Ojea 8b579374f7 verify grpc experimental apis
The GRPC community expressed their concern about a possible breakage on
the etcd project when they switch or remove some of the experimental
APIs. The GRPC community clearly express their contract around these
APIs, however the etcd project has some features that build on that.

As a norm we must not build on these kind of APIs, so we can set a
linter to avoid this to happen again and run in each presubmit.

Signed-off-by: Antonio Ojea <aojea@google.com>
2026-01-09 12:13:28 +00:00
Chun-Hung Tseng b704bec5e4 scripts: add support for MacOS in update_go_workspace.sh
Add OS detection for sed in-place editing (BSD vs GNU) to use a
portable sed insert syntax with literal newlines.

Also, replace `dirname -z` (GNU-specific) with while-read loop

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
Signed-off-by: Chun-Hung Tseng <henrytseng@google.com>
2026-01-08 17:46:36 +09:00
Chun-Hung Tseng 6027c7157e scripts: improve update_dep.sh for better dependency management
Improvements to the update_dep.sh script:
- Add argument validation and usage instructions
- Add print_current_dep_version function to show versions before/after
- Add is_fully_indirect function with confirmation prompt for indirect deps
- Improve update_module to use go mod edit for reliable indirect dep updates
- Make version parameter optional (defaults to latest)
- Fix bash 3.2 compatibility with ${2:-} syntax
- Reduce logging noise by only logging when actually updating

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
Signed-off-by: Chun-Hung Tseng <henrytseng@google.com>
2026-01-08 17:46:36 +09:00
Davanum Srinivas 386eb3023d test: fix robustness tests failing with undefined -bin-dir flag
The robustness CI jobs are failing with "flag provided but not defined:
-bin-dir" because the test path includes subpackages (./tests/robustness/...)
that don't register this flag.

PR 20962 changed the test invocation to use ./tests/robustness/... which
runs tests in all subpackages. The validate/ and model/ subpackages contain
unit tests that don't import framework/e2e (which registers -bin-dir), so
they fail when this flag is passed.

PR 21039 attempted to fix the issue but only changed the test runner
function, not the package path.

This change removes the /... suffix to only run tests in the main
robustness package, restoring the original behavior.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-21 16:08:06 -05:00
Ivan Valdes 8fddf7d1fe Fix robustness tests execution
Remove running the tests for all the packages under ./tests/robustness.
Restore the old behavior of running only the tests from the top-level
robustness package.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-12-18 21:58:17 -08:00
Ivan Valdes 5718233f0b Fix run_go_tests_expanding_packages argument parsing
Escape the regular expression, and ensure to capture go.etcd.io
packages, too. As defined in `run_go_tests`.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-12-17 16:30:55 -08:00
Ivan Valdes e8ed6c3f21 Migrate robustness tests to use Go workspace
Switch the robustness tests to use the new run_go_tests function.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-11-20 15:01:49 -08:00
Ivan Valdes e1c2aaef98 Migrate grpcproxy tests to use Go workspace
Switch the grpcproxy integration and e2e tests to use the new
run_go_tests function.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-11-19 14:14:50 -08:00
Marek Siarkowicz d6f85c53d6 Disable optimization and inlining for Antithesis to make using debugger easier
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2025-11-16 22:56:33 +01:00
Benjamin Wang 9422ca0051 Merge pull request #20909 from ivanvc/migrate-integration-tests
Migrate integration tests to use Go workspace
2025-11-14 11:36:49 +00:00
Ivan Valdes 570c124214 Migrate e2e tests to use Go workspace
Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-11-12 09:59:29 -05:00
Ivan Valdes eef2b22c21 Migrate integration tests to use Go workspace
Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-11-09 16:04:46 -05:00
Ivan Valdes cef82740c3 Migrate unit tests to use Go workspace
Introduce the new functions: run_go_tests and
run_go_test_expanding_packages, which implement (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>
2025-11-03 16:53:49 -08:00
Ivan Valdes 3e57a179da Replace GOLANG_TEST_SHORT with testing.Short()
Remove the custom environment variable GOLANG_TEST_SHORT.

It is currently used by Main tests (TestMain), as we can't skip tests
because testing.M doesn't implement testing.TB. It is possible to do a
clean os.Exit(0) (current behavior), but calling testing.Short() fails
because this function expects flags to be parsed before.

So, it is possible to remove the custom behavior (GOLANG_TEST_SHORT) by
parsing flags (if required) before calling testing.Short(), then
immediately exit if the result is true (-short flag is set).

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-30 10:19:54 -07:00
Ivan Valdes 6829e34749 Delete scripts/fix.sh
All of the passes have been moved out to different script files.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-28 14:15:27 -07:00
Ivan Valdes 75c5654138 Move fix-bashws to its own script
Follow the approach of a script per Makefile target. Rename it to
shell_ws for consistency with the verify target.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-27 23:00:40 -07:00
Benjamin Wang 0ca76b28c4 Merge pull request #20858 from ivanvc/use-golangci-lint-gofmt-fix
Don't manually run go fmt
2025-10-27 09:13:46 +00:00
Benjamin Wang 4807b85fe8 Merge pull request #20857 from ivanvc/update-fix-yamllint-to-use-new-script
Update fix-yamllint Makefile target to use stand-alone script
2025-10-26 10:10:34 +00:00
Ivan Valdes 1bb0d8476d Don't manually run go fmt
We're already calling golangci-lint --fix. We require the gofmt
formatter, and it supports autofix. Therefore, running go fmt manually
after golangci-lint --fix runs doesn't have any effect.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-26 00:17:55 -07:00
Benjamin Wang 6dc06f19b2 Merge pull request #20848 from ivanvc/update-verify-dep-to-use-workspace
Update verify-dep to use workspace helpers
2025-10-25 14:07:52 +01:00
Ivan Valdes b16a46eaad Update fix-yamllint to use a new stand-alone script
Implement a new stand-alone script to move the target body out of the
Makefile.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-24 16:30:30 -07:00
Benjamin Wang ee6aad2e47 Fix the golangci-lint installation script to get the correct GOPATH
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2025-10-24 10:45:42 +01:00
Marek Siarkowicz 2a7f098e06 Merge pull request #20851 from ivanvc/move-fix-go-mod-to-a-makefile-target
Move go mod tidy to a test.sh pass, update it to use the Go workspace
2025-10-24 11:33:06 +02:00
Ivan Valdes f5efd747fe Move go mod tidy to a test.sh pass
Use the new workspace helper functions.

By moving it to a test.sh pass, we can chain it in the fix Makefile
target prerequisites, and it can be called before update-go-workspace.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-23 21:08:52 -07:00
Ivan Valdes 16c44e2eb5 Update gomodguard to use workspace modules
Optimize running the gomodguard binary, by only installing it once.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-23 15:58:04 -07:00
Ivan Valdes 2d18e5d10e Update verify-dep to use workspace helpers
There's no need to add an exception for tools/mod anymore, as this is
considered part of the workspace.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-23 15:17:25 -07:00
Benjamin Wang 1f1750b196 Merge pull request #20828 from ivanvc/update-mod-tidy-check
Update mod tidy check to not use old module system
2025-10-23 16:45:35 +01:00
Ivan Valdes 5ea3e184fe Update mod tidy check to use the workspace modules
Use a new function for commands that need to change directories to the
Go workspace module sub directory. For example, go mod doesn't receive
arguments, it needs to run from the directory that has the go.mod file.

Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-22 17:26:46 -07:00
Ivan Valdes 5bf8e5ae50 Use workspace modules to generate the bom
Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-22 13:11:34 -07:00
Ivan Valdes be2e2306c3 Use workspace modules for verify bom
Signed-off-by: Ivan Valdes <ivan@vald.es>
2025-10-22 13:09:12 -07:00