Skip to content

Commit 3c6c6ab

Browse files
committed
Flip --incompatible_check_sharding_support
RELNOTES[INC]: `--incompatible_check_sharding_support` is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to bazelbuild#18339 for migration advice.
1 parent 7fee4d1 commit 3c6c6ab

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public static class TestOptions extends FragmentOptions {
293293

294294
@Option(
295295
name = "incompatible_check_sharding_support",
296-
defaultValue = "false",
296+
defaultValue = "true",
297297
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
298298
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
299299
effectTags = {OptionEffectTag.UNKNOWN},

src/test/py/bazel/test_wrapper_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def _CreateMockWorkspace(self):
7070
'bat_test(',
7171
' name = "sharded_test",',
7272
' content = [',
73+
' "copy /b %TEST_SHARD_STATUS_FILE% +,,"',
7374
' "@echo STATUS=%TEST_SHARD_STATUS_FILE%",',
7475
' "@echo INDEX=%TEST_SHARD_INDEX% TOTAL=%TEST_TOTAL_SHARDS%",',
7576
' ],',

src/test/shell/bazel/bazel_test_test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,10 @@ EOF
540540
function test_xml_fallback_for_sharded_test() {
541541
mkdir -p dir
542542

543-
cat <<EOF > dir/test.sh
543+
cat <<'EOF' > dir/test.sh
544544
#!/bin/sh
545-
exit \$((TEST_SHARD_INDEX == 1))
545+
touch "$TEST_SHARD_STATUS_FILE"
546+
exit $((TEST_SHARD_INDEX == 1))
546547
EOF
547548

548549
chmod +x dir/test.sh

0 commit comments

Comments
 (0)