Skip to content

Commit c3b9b4f

Browse files
committed
backport staleness changes to 25.x
1 parent fb0520e commit c3b9b4f

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

regenerate_stale_files.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,28 @@ cd $(dirname -- "$0")
1212

1313
readonly BazelBin="${BAZEL:-bazel} ${BAZEL_STARTUP_FLAGS}"
1414

15+
STALENESS_TESTS=(
16+
"java/core:generated_java_defaults_staleness_test"
17+
"upb/reflection:bootstrap_upb_defaults_staleness_test"
18+
"src:cmake_lists_staleness_test"
19+
"src/google/protobuf:well_known_types_staleness_test"
20+
"objectivec:well_known_types_staleness_test"
21+
"php:test_amalgamation_staleness"
22+
"ruby/ext/google/protobuf_c:test_amalgamation_staleness"
23+
"upb/cmake:test_generated_files"
24+
"upb/reflection:descriptor_upb_proto_staleness_test"
25+
"upb_generator:plugin_upb_proto_staleness_test"
26+
)
27+
1528
# Run and fix all staleness tests.
16-
${BazelBin} test src:cmake_lists_staleness_test "$@" || ./bazel-bin/src/cmake_lists_staleness_test --fix
17-
${BazelBin} test src/google/protobuf:well_known_types_staleness_test "$@" || ./bazel-bin/src/google/protobuf/well_known_types_staleness_test --fix
18-
${BazelBin} test objectivec:well_known_types_staleness_test "$@" || ./bazel-bin/objectivec/well_known_types_staleness_test --fix
19-
${BazelBin} test php:test_amalgamation_staleness "$@" || ./bazel-bin/php/test_amalgamation_staleness --fix
20-
${BazelBin} test ruby/ext/google/protobuf_c:test_amalgamation_staleness "$@" || ./bazel-bin/ruby/ext/google/protobuf_c/test_amalgamation_staleness --fix
21-
${BazelBin} test upb/cmake:test_generated_files "$@" || ./bazel-bin/upb/cmake/test_generated_files --fix
29+
for test in ${STALENESS_TESTS[@]}; do
30+
${BazelBin} test $test "$@" || ./bazel-bin/${test%%:*}/${test#*:} --fix
31+
done
2232

2333
# Generate C# code.
2434
# This doesn't currently have Bazel staleness tests, but there's an existing
2535
# shell script that generates everything required. The output files are stable,
26-
# so just regenerating in place should be harmless.
36+
# so just regenerating in place should be harmless.
2737
${BazelBin} build src/google/protobuf/compiler:protoc "$@"
2838
(export PROTOC=$PWD/bazel-bin/protoc && cd csharp && ./generate_protos.sh)
2939

0 commit comments

Comments
 (0)