Skip to content

Commit

Permalink
Windows, test-wrapper: rename flag in Bazel
Browse files Browse the repository at this point in the history
Rename the "--windows_native_test_wrapper" flag to
"--incompatible_windows_native_test_wrapper", in
order to comply with the "Communicating Breaking
Changes in Bazel" policy (see
https://groups.google.com/forum/#!msg/bazel-dev/DKgObFj6Q-0/HRCm_xJRAAAJ)

The flag (and the feature it guards) is not yet in
use so this change should not affect anyone.

See:
#5508
#6622

Change-Id: I7606114ad3e82da662bece63997d03d1d9c2fc8e

Closes #6623.

Change-Id: I7606114ad3e82da662bece63997d03d1d9c2fc8e
PiperOrigin-RevId: 220445813
  • Loading branch information
laszlocsomor authored and Copybara-Service committed Nov 7, 2018
1 parent c983241 commit 4c5b359
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.devtools.common.options.OptionDefinition;
import com.google.devtools.common.options.OptionDocumentationCategory;
import com.google.devtools.common.options.OptionEffectTag;
import com.google.devtools.common.options.OptionMetadataTag;
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.TriState;
Expand Down Expand Up @@ -123,12 +124,11 @@ public static class TestOptions extends FragmentOptions {

@Deprecated
@Option(
name = "test_result_expiration",
defaultValue = "-1", // No expiration by defualt.
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
help = "This option is deprecated and has no effect."
)
name = "test_result_expiration",
defaultValue = "-1", // No expiration by default.
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
help = "This option is deprecated and has no effect.")
public int testResultExpiration;

@Option(
Expand Down Expand Up @@ -231,20 +231,24 @@ public static class TestOptions extends FragmentOptions {
public Label coverageReportGenerator;

@Option(
name = "windows_native_test_wrapper",
// Undocumented: this features is under development and not yet ready for production use.
// We define the flag to be able to test the feature.
name = "incompatible_windows_native_test_wrapper",
// Design:
// https://github.com/laszlocsomor/proposals/blob/win-test-runner/designs/2018-07-18-windows-native-test-runner.md
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
documentationCategory = OptionDocumentationCategory.TESTING,
// Affects loading and analysis: this flag affects which target Bazel loads and creates test
// actions with on Windows.
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
effectTags = {
OptionEffectTag.LOADING_AND_ANALYSIS,
OptionEffectTag.TEST_RUNNER,
},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES,
},
defaultValue = "false",
help =
"Do not use yet, this flag's functionality is not yet implemented. "
+ "(On Windows: if true, uses the C++ test wrapper to run tests, otherwise uses "
+ "tools/test/test-setup.sh as on other platforms. On other platforms: no-op.)")
"On Windows: if true, uses the C++ test wrapper to run tests, otherwise uses "
+ "tools/test/test-setup.sh as on other platforms. On other platforms: no-op.")
public boolean windowsNativeTestWrapper;

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/test/py/bazel/test_wrapper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _AssertTestArgs(self, flag, expected):

def testTestExecutionWithTestSetupSh(self):
self._CreateMockWorkspace()
flag = '--nowindows_native_test_wrapper'
flag = '--noincompatible_windows_native_test_wrapper'
self._AssertPassingTest(flag)
self._AssertFailingTest(flag)
self._AssertPrintingTest(flag)
Expand Down Expand Up @@ -328,7 +328,7 @@ def testTestExecutionWithTestWrapperExe(self):
# As of 2018-09-11, the Windows native test runner can run simple tests and
# export a few envvars, though it does not completely set up the test's
# environment yet.
flag = '--windows_native_test_wrapper'
flag = '--incompatible_windows_native_test_wrapper'
self._AssertPassingTest(flag)
self._AssertFailingTest(flag)
self._AssertPrintingTest(flag)
Expand Down

0 comments on commit 4c5b359

Please sign in to comment.