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>
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>
- 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>
- 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>
- 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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>