From 4c5b359453cd9a8b65374f9d62d960a279987331 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Wed, 7 Nov 2018 05:08:31 -0800 Subject: [PATCH] Windows, test-wrapper: rename flag in Bazel 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: https://github.com/bazelbuild/bazel/issues/5508 https://github.com/bazelbuild/bazel/issues/6622 Change-Id: I7606114ad3e82da662bece63997d03d1d9c2fc8e Closes #6623. Change-Id: I7606114ad3e82da662bece63997d03d1d9c2fc8e PiperOrigin-RevId: 220445813 --- .../lib/analysis/test/TestConfiguration.java | 32 +++++++++++-------- src/test/py/bazel/test_wrapper_test.py | 4 +-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java index 3ce491843ffe05..753c684b3f5bea 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java @@ -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; @@ -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( @@ -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 diff --git a/src/test/py/bazel/test_wrapper_test.py b/src/test/py/bazel/test_wrapper_test.py index 6058b1afbd263e..e55796ca5cb9f2 100644 --- a/src/test/py/bazel/test_wrapper_test.py +++ b/src/test/py/bazel/test_wrapper_test.py @@ -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) @@ -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)